77#include <OgreMaterialManager.h>
78#include <OgreSceneManager.h>
79#include <OgreMovableObject.h>
80#include <OgreParticleSystem.h>
81#include <OgreEntity.h>
83#include <fmt/format.h>
94 if (sectionconfig !=
"")
96 auto result = def->user_modules.find(sectionconfig);
98 if (result != def->user_modules.end())
101 LOG(
" == ActorSpawner: Module added to configuration: " + sectionconfig);
125 auto module = util.TransformToRigDefModule(addonpart_entry);
130 LOG(
" == ActorSpawner: Addon part added to configuration: " + addonpart);
151 App::GetCacheSystem()->LoadAssetPack(actor->getUsedActorEntry(), assetpack.filename);
167 for (
auto& def: module_def->
nodes)
220 req.
num_beams += wheel.num_rays * ((wheel.rigidity_node.IsValidAnyState()) ? 9 : 8);
229 req.
num_beams += wheel2.num_rays * ((wheel2.rigidity_node.IsValidAnyState()) ? 25 : 24);
236 req.
num_beams += meshwheel.num_rays * ((meshwheel.rigidity_node.IsValidAnyState()) ? 9 : 8);
240 req.
num_nodes += meshwheel2.num_rays * 2;
241 req.
num_beams += meshwheel2.num_rays * ((meshwheel2.rigidity_node.IsValidAnyState()) ? 9 : 8);
251 req.
num_beams += flexwheel.num_rays * ((flexwheel.rigidity_node.IsValidAnyState()) ? 21 : 20);
276 for (
size_t i = 0; i < req.
num_nodes; ++i)
342#ifdef USE_ANGELSCRIPT
412 "Failed to load built-in material 'tracks/simple'; disabling 'SimpleMaterials'");
482 float proped_wheels_radius_sum = 0.0f;
522 if ((a1 == i - 1) && (a2 == i - 0))
555 float max_dist = 0.0f;
569 float offset = atan2(dir.dotProduct(Ogre::Vector3::UNIT_Z), dir.dotProduct(Ogre::Vector3::UNIT_X));
589 Ogre::Vector3 cross = dir_node_offset.crossProduct(roll_node_offset);
650 if (wcent.x>prop.x && wcent.x<prop.x+15.0)
653 if (wcent.y>prop.y-radius && wcent.y<prop.y+radius)
658 float pleft=prop.z+radius;
659 float pright=prop.z-radius;
661 if (pleft<aleft) aleft=pleft;
663 if (pright>aright) aright=pright;
667 float wratio=(aleft-aright)/(wleft-wright);
691 Ogre::Entity* afterburn_ent =
nullptr;
701 propname, nozzle_ent, afterburn_ent);
725 return fmt::format(
"{}#{} ({} [Instance ID {}])",
730 return fmt::format(
"{} ({} [Instance ID {}])",
817 Ogre::String
const & airfoil,
826 this->
ComposeName(
"turboprop", aeroengine_index).c_str(),
855 if ((prop.pp_node_ref == ref_node_index) && (prop.pp_aero_propeller_blade || prop.pp_aero_propeller_spin))
857 prop.pp_scene_node->scale(scale, scale, scale);
858 prop.pp_aero_engine_idx = aeroengine_index;
915 this->
ComposeName(
"airbrake", airbrake_idx).c_str(),
946 ab->
offset = Ogre::Vector3::ZERO;
979 this->GetNodeIndexOrThrow(def.
nodes[2]),
980 this->GetNodeIndexOrThrow(def.
nodes[3]),
981 this->GetNodeIndexOrThrow(def.
nodes[4]),
982 this->GetNodeIndexOrThrow(def.
nodes[5]),
983 this->GetNodeIndexOrThrow(def.
nodes[6]),
984 this->GetNodeIndexOrThrow(def.
nodes[7]),
999 Ogre::Entity* entity =
nullptr;
1010 delete flex_airfoil;
1027 if (node1 != previous_wing.
fa->
nfld)
1062 left_green_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/greenflare");
1066 left_green_prop.
pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1084 left_flash_prop.
pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1085 left_flash_prop.
pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1086 left_flash_prop.
pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1096 left_flash_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/flare");
1100 left_flash_prop.
pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1125 right_red_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/redflare");
1129 right_red_prop.
pp_beacon_bbs[0]->setDefaultDimensions(0.5, 0.5);
1147 right_flash_prop.
pp_beacon_light[0]->setDiffuseColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1148 right_flash_prop.
pp_beacon_light[0]->setSpecularColour( Ogre::ColourValue(1.0, 1.0, 1.0));
1149 right_flash_prop.
pp_beacon_light[0]->setAttenuation(50.0, 1.0, 0.3, 0.0);
1159 right_flash_prop.
pp_beacon_bbs[0]->setMaterialName(
"tracks/flare");
1163 right_flash_prop.
pp_beacon_bbs[0]->setDefaultDimensions(1.0, 1.0);
1194 return (((
x-ref).crossProduct(
y-ref)).length()+((
x-aref).crossProduct(
y-aref)).length())*0.5f;
1228 if (sound_script ==
nullptr)
1253 auto itor = def.
nodes.begin();
1254 auto end = def.
nodes.end();
1255 for(; itor != end; ++itor)
1282 if (def.
key ==
"helpMaterial")
1287 else if (def.
key ==
"speedoMax")
1290 if (maxKph > 10 && maxKph < 32000)
1297 fmt::format(
"Invalid 'speedoMax' ({}), allowed range is <10 -32000>, using default ({})", maxKph,
DEFAULT_SPEEDO_MAX_KPH));
1301 else if (def.
key ==
"useMaxRPM")
1305 else if (def.
key ==
"shifterAnimTime")
1309 else if (def.
key ==
"tachoMaterial")
1313 else if (def.
key ==
"speedoMaterial")
1340 if (template_name ==
"" || template_name ==
"default")
1342 template_name =
"tracks/Smoke";
1350 if (exhaust.
smoker ==
nullptr)
1352 std::stringstream msg;
1353 msg <<
"Failed to create particle system '" << name <<
"' (template: '" << template_name <<
"')";
1373 for (; module_itor != module_end; ++module_itor)
1375 if (! module_itor->get()->submesh_groundmodel.empty())
1377 return module_itor->get()->submesh_groundmodel[0];
1380 return std::string();
1392 std::vector<RigDef::Texcoord>::iterator texcoord_itor = def.
texcoords.begin();
1393 for ( ; texcoord_itor != def.
texcoords.end(); texcoord_itor++)
1411 for ( ; cab_itor != cab_itor_end; ++cab_itor)
1419 std::stringstream msg;
1420 msg <<
"Collcab limit (" <<
MAX_CABS <<
") exceeded";
1425 bool mk_buoyance =
false;
1468 std::stringstream msg;
1469 msg <<
"Collcab limit (" <<
MAX_CABS <<
") exceeded";
1475 std::stringstream msg;
1476 msg <<
"Buoycab limit (" <<
MAX_CABS <<
") exceeded";
1578 std::vector<unsigned int> node_indices;
1579 bool nodes_found =
true;
1585 nodes_found =
false;
1588 node_indices.push_back(node);
1592 std::vector<ForvertTempData> forverts_tmp;
1593 for (
size_t i = 0; i < def.
forvert.size(); i++)
1595 const auto& forvert_item = def.
forvert[i];
1606 fmt::format(
"Flexbody {}({}) 'forvert'{}/{}: Some nodes not resolved (nref {}->{}, nx {}->{}, ny {}->{}).",
1615 forverts_tmp.push_back(fvtd);
1649 catch (Ogre::Exception&)
1672 pprop.
pp_id = prop_id;
1681 prop.
pp_id = prop_id;
1688 prop.
pp_rot = Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.z), Ogre::Vector3::UNIT_Z)
1689 * Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.y), Ogre::Vector3::UNIT_Y)
1690 * Ogre::Quaternion(Ogre::Degree(prop.
pp_rota.x), Ogre::Vector3::UNIT_X);
1710 Ogre::Vector3 steering_wheel_offset = Ogre::Vector3::ZERO;
1713 steering_wheel_offset = Ogre::Vector3(-0.67, -0.61,0.24);
1717 steering_wheel_offset = Ogre::Vector3(0.67, -0.61,0.24);
1719 if (steering_wheel_offset != Ogre::Vector3::ZERO)
1732 this->ComposeName(
"steering wheel entity @ prop", prop_id),
1744 this->ComposeName(
"prop entity", prop_id),
1793 pp_beacon_light->setType(Ogre::Light::LT_SPOTLIGHT);
1796 pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1797 pp_beacon_light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1798 pp_beacon_light->setCastShadows(
false);
1799 pp_beacon_light->setVisible(
false);
1804 if (flare_billboard_sys)
1806 flare_billboard_sys->createBillboard(0,0,0);
1807 flare_billboard_sys->setMaterialName(prop.
pp_media[1]);
1809 flare_scene_node->attachObject(flare_billboard_sys);
1811 flare_scene_node->setVisible(
false);
1825 pp_beacon_light->setType(Ogre::Light::LT_POINT);
1826 pp_beacon_light->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1827 pp_beacon_light->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1828 pp_beacon_light->setAttenuation(50.0, 1.0, 0.3, 0.0);
1829 pp_beacon_light->setCastShadows(
false);
1830 pp_beacon_light->setVisible(
false);
1834 if (flare_billboard_sys)
1836 flare_billboard_sys->createBillboard(0,0,0);
1837 flare_billboard_sys->setMaterialName(
"tracks/redbeaconflare");
1839 flare_billboard_sys->setDefaultDimensions(1.0, 1.0);
1840 flare_scene_node->attachObject(flare_billboard_sys);
1842 flare_scene_node->setVisible(
false);
1854 for (
int k=0; k<4; k++)
1864 prop.
pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1865 prop.
pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(1.0, 0.0, 0.0));
1869 prop.
pp_beacon_light[k]->setDiffuseColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1870 prop.
pp_beacon_light[k]->setSpecularColour( Ogre::ColourValue(0.0, 0.5, 1.0));
1873 prop.
pp_beacon_light[k]->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
1884 prop.
pp_beacon_bbs[k]->setMaterialName(
"tracks/brightredflare");
1888 prop.
pp_beacon_bbs[k]->setMaterialName(
"tracks/brightblueflare");
1917 if (anim_def.ratio == 0)
1919 std::stringstream msg;
1920 msg <<
"Prop (mesh: " << def.
mesh_name <<
") has invalid animation ratio (0), using it anyway (compatibility)...";
2051 std::list<RigDef::Animation::MotorSource>::iterator source_itor = anim_def.motor_sources.begin();
2052 for ( ; source_itor != anim_def.motor_sources.end(); source_itor++)
2057 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2061 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2065 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2069 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2073 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2079 anim.
animOpt3 =
static_cast<float>(source_itor->motor);
2085 anim_def.event_name !=
"")
2104 anim_def.dash_link_name !=
"")
2114 anim.
animOpt3 =
static_cast<float>(link_id);
2152 const bool use_default_lower_limit = (anim_def.lower_limit == 0.f);
2153 const bool use_default_upper_limit = (anim_def.upper_limit == 0.f);
2156 anim.
lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.
pp_rota.x);
2157 anim.
upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.
pp_rota.x);
2160 anim.
lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.
pp_rota.y);
2161 anim.
upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.
pp_rota.y);
2164 anim.
lower_limit = (use_default_lower_limit) ? (-180.f) : (anim_def.lower_limit + prop.
pp_rota.z);
2165 anim.
upper_limit = (use_default_upper_limit) ? ( 180.f) : (anim_def.upper_limit + prop.
pp_rota.z);
2220 if (f.
bbs !=
nullptr)
2223 f.
bbs->setMaterial(f.
bbs->getMaterial()->clone(f.
snode->getName() +
"_mat"));
2232 float size = def.
size;
2237 if (blink_delay == -2)
2261 flare.
blinkdelay = (blink_delay == -1) ? 0.5f : blink_delay / 1000.f;
2283 fmt::format(
"Bad flare control num {}, must be 1-{}, using 1.",
2290 fmt::format(
"Bad flare control num {}, must be 1-{}, using {}.",
2306 fmt::format(
"Disabling 'd' flare - invalid input link '{}'", def.
dashboard_link));
2307 is_placeholder =
true;
2312 std::string flare_name = this->
ComposeName(
"Flare", flare_id);
2313 if (!is_placeholder)
2327 if (flare.
bbs !=
nullptr)
2329 flare.
bbs->createBillboard(0,0,0);
2332 if (using_default_material)
2336 material_name =
"tracks/brakeflare";
2340 material_name =
"tracks/blinkflare";
2344 material_name =
"tracks/greenflare";
2348 material_name =
"tracks/redflare";
2352 material_name =
"tracks/flare";
2359 flare.
bbs->setMaterial(material);
2360 flare.
snode->attachObject(flare.
bbs);
2364 flare.
light =
nullptr;
2371 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2372 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2373 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2374 flare.
light->setAttenuation(200, 0.9, 0, 0);
2375 flare.
light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2376 flare.
light->setCastShadows(
false);
2381 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2382 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2383 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2384 flare.
light->setAttenuation(400, 0.9, 0, 0);
2385 flare.
light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2386 flare.
light->setCastShadows(
false);
2391 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2392 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2393 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2394 flare.
light->setAttenuation(400, 0.9, 0, 0);
2395 flare.
light->setSpotlightRange(Ogre::Degree(35), Ogre::Degree(45));
2396 flare.
light->setCastShadows(
false);
2404 flare.
light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2405 flare.
light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2406 flare.
light->setAttenuation(10.0, 1.0, 0, 0);
2411 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2412 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2413 flare.
light->setAttenuation(20.0, 1, 0, 0);
2418 flare.
light->setDiffuseColour( Ogre::ColourValue(1.0, 0, 0));
2419 flare.
light->setSpecularColour( Ogre::ColourValue(1.0, 0, 0));
2420 flare.
light->setAttenuation(10.0, 1.0, 0, 0);
2425 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 0));
2426 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 0));
2427 flare.
light->setAttenuation(10.0, 1, 1, 0);
2432 flare.
light->setDiffuseColour( Ogre::ColourValue(1, 1, 1));
2433 flare.
light->setSpecularColour( Ogre::ColourValue(1, 1, 1));
2434 flare.
light->setAttenuation(1.0, 1.0, 1, 0.2);
2439 flare.
light->setDiffuseColour(Ogre::ColourValue(1, 1, 1));
2440 flare.
light->setSpecularColour(Ogre::ColourValue(1, 1, 1));
2441 flare.
light->setAttenuation(5.0, 1.0, 1, 0.2);
2446 if (flare.
light !=
nullptr)
2448 flare.
light->setType(Ogre::Light::LT_SPOTLIGHT);
2449 flare.
light->setSpotlightRange( Ogre::Degree(35), Ogre::Degree(45) );
2450 flare.
light->setCastShadows(
false);
2457 LOG(fmt::format(
"[RoR|ActorSpawner] processing FlaregroupNoImport ({} {})", (
char)def.
type, def.
control_number));
2492 Ogre::MaterialPtr src_mat = Ogre::MaterialManager::getSingleton().getByName(source_name, rg_name);
2495 std::stringstream msg;
2496 msg <<
"Built-in material '" << source_name <<
"' missing! Skipping...";
2498 return Ogre::MaterialPtr();
2501 return src_mat->clone(clone_name);
2520 if (!Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
diffuse_map))
2527 !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
damaged_diffuse_map))
2534 !Ogre::ResourceGroupManager::getSingleton().resourceExists(resource_group, def.
specular_map))
2546 std::string module_rg = (
module->origin_addonpart) ? module->origin_addonpart->resource_group : m_actor->getTruckFileResourceGroup();
2547 if (!Ogre::MaterialManager::getSingleton().getByName(def.
name, module_rg))
2549 LOG(fmt::format(
"[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Creating placeholder for material '{}' in group '{}'", def.
name, module_rg));
2554 LOG(fmt::format(
"[RoR] DBG ActorSpawner::ProcessManagedMaterial(): Placeholder already exists: '{}' in group '{}'", def.
name, module_rg));
2559 Ogre::MaterialPtr material;
2563 material = Ogre::MaterialManager::getSingleton().getByName(
"tracks/transred")->clone(custom_name,
true, resource_group);
2567 std::string mat_name_base
2569 ?
"managed/flexmesh_standard"
2570 :
"managed/flexmesh_transparent";
2662 Ogre::String mat_name_base
2664 ?
"managed/mesh_standard"
2665 :
"managed/mesh_transparent";
2714 material->getTechnique(
"BaseTechnique")->getPass(
"BaseRender")->setCullingMode(Ogre::CULL_NONE);
2719 material->getTechnique(
"BaseTechnique")->getPass(
"SpecularMapping1")->setCullingMode(Ogre::CULL_NONE);
2723 material->getTechnique(
"BaseTechnique")->getPass(
"Specular")->setCullingMode(Ogre::CULL_NONE);
2729 material->compile();
2741 RoR::LogFormat(
"[RoR|Spawner] Collision box: skipping invalid node '%s'", node_ref.ToString().c_str());
2746 RoR::LogFormat(
"[RoR|Spawner] Collision box: re-assigning node '%s' from box ID '%d' to '%d'",
2747 node_ref.ToString().c_str(),
2775 _out_axle_wheel = i;
2798 std::stringstream msg;
2799 msg <<
"Couldn't find wheel with axis nodes '" << def.
wheels[0][0].
ToString()
2806 std::stringstream msg;
2807 msg <<
"Couldn't find wheel with axis nodes '" << def.
wheels[1][0].
ToString()
2821 for (
auto itor = def.
options.begin(); itor != end; ++itor)
2861 AddMessage(
Message::TYPE_ERROR,
"You cannot have both an inter-axle differential and a transfercase between the same two axles, skipping...");
2948 std::stringstream msg;
2950 <<
") must be positive nonzero number. Using it anyway (compatibility)";
2978 std::vector<RigDef::TorqueCurve::Sample>::iterator itor = def.
samples.begin();
2979 for ( ; itor != def.
samples.end(); itor++)
2981 target_torque_curve->
AddCurveSample(itor->power, itor->torque_percent);
3001 if (particle.
psys ==
nullptr)
3003 std::stringstream msg;
3004 msg <<
"Failed to create particle system '" << name <<
"' (template: '" << def.
particle_system_name <<
"')";
3010 particle.
snode->attachObject(particle.
psys);
3152 if (rail_group ==
nullptr)
3154 std::stringstream msg;
3155 msg <<
"Specified rail group id '" << def.
railgroup_id <<
"' not found. Ignoring slidenode...";
3163 if (rail_group !=
nullptr)
3178 std::vector<RigDef::Node::Range> & node_ranges,
3179 std::vector<NodeNum_t> & out_node_indices
3182 std::vector<RigDef::Node::Range>::iterator itor = node_ranges.begin();
3183 for ( ; itor != node_ranges.end(); itor++)
3185 if (itor->IsRange())
3197 std::stringstream msg;
3198 msg <<
"Encountered non-existent node '" << itor->end.ToString() <<
"' in range [" << itor->start.ToString() <<
" - " << itor->end.ToString() <<
"], "
3201 if (itor->end.Str().empty())
3203 msg <<
" However, this node must be accepted anyway for backwards compatibility."
3204 <<
" Please fix this as soon as possible.";
3205 end = itor->end.Num();
3222 for (
NodeNum_t i = start; i <= end; i++)
3224 out_node_indices.push_back(i);
3238 std::vector<NodeNum_t> node_indices;
3243 for (
unsigned int i = 0; i < node_indices.size() - 1; i++)
3246 if (beam ==
nullptr)
3248 std::stringstream msg;
3249 msg <<
"No beam between nodes indexed '" << node_indices[i] <<
"' and '" << node_indices[i + 1] <<
"'";
3259 for (
size_t i = 1; i < (num_seg - 1); ++i)
3266 const bool is_loop = (node_indices.front() == node_indices.back());
3303 if (node ==
nullptr)
3313 if (itor->hk_hook_node == node)
3320 if (hook ==
nullptr)
3322 std::stringstream msg;
3323 msg <<
"Node '" << def.
node.
ToString() <<
"' is not a hook-node (not marked with flag 'h'), ignoring...";
3354 int beam_index = -1;
3371 auto itor = lockgroup.
nodes.begin();
3372 auto end = lockgroup.
nodes.end();
3373 for (; itor != end; ++itor)
3386 bool invisible =
false;
3388 bool shock_trigger_enabled =
true;
3389 bool triggerblocker =
false;
3390 bool triggerblocker_inverted =
false;
3391 bool cmdkeyblock =
false;
3392 bool hooktoggle =
false;
3393 bool enginetrigger =
false;
3395 bool trigger_cmdkeyblock_state_short =
false;
3396 bool trigger_cmdkeyblock_state_long =
true;
3406 shock_trigger_enabled =
false;
3411 triggerblocker =
true;
3423 sbound = abs(sbound-1);
3429 triggerblocker_inverted =
true;
3448 enginetrigger =
true;
3451 if (!triggerblocker && !triggerblocker_inverted && !hooktoggle && !enginetrigger)
3460 else if (!hooktoggle && !enginetrigger)
3469 else if (enginetrigger)
3509 LOG(
"Trigger added. BeamID " +
TOSTRING(beam_index));
3513 beam.
shock = &shock;
3514 shock.
beamid = beam_index;
3516 if (!triggerblocker && !triggerblocker_inverted)
3526 if (!triggerblocker_inverted)
3542 if (cmdkeyblock && !triggerblocker)
3544 trigger_cmdkeyblock_state_short =
true;
3552 shock.
flags = shockflag;
3581 for (
unsigned int i = 0; i < 4; i++)
3617 for (
unsigned int i = 0; i < 4; i++)
3653 std::string start_function;
3654 std::string stop_function;
3681 Ogre::String start_function;
3682 Ogre::String stop_function;
3750 float center_length = 0.f;
3776 contract_command->
beams.push_back(cmd_beam);
3786 extend_command->
beams.push_back(cmd_beam);
3811 bool must_insert_qpair =
true;
3818 must_insert_qpair =
false;
3826 if (must_insert_qpair)
3840 float anim_option = 0;
4002 std::shared_ptr<RigDef::BeamDefaults> & beam_defaults,
4012 float strength = beam_defaults->breaking_threshold;
4018 float plastic_coef = beam_defaults->plastic_deform_coef;
4031 bool invisible =
false;
4032 unsigned int hydro_flags = 0;
4126 short_bound /= beam_length;
4127 long_bound /= beam_length;
4132 short_bound = (beam_length - short_bound) / beam_length;
4133 long_bound = (long_bound - beam_length) / beam_length;
4135 if (long_bound < 0.f)
4139 "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4144 if (short_bound > 1.f)
4148 "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4179 shock.
flags = shock_flags;
4195 beam.
shock = & shock;
4196 shock.
beamid = beam_index;
4215 short_bound /= beam_length;
4216 long_bound /= beam_length;
4221 short_bound = (beam_length - short_bound) / beam_length;
4222 long_bound = (long_bound - beam_length) / beam_length;
4224 if (long_bound < 0.f)
4228 "Metric shock length calculation failed, 'short_bound' less than beams spawn length. Resetting to beam's spawn length (short_bound = 0)"
4233 if (short_bound > 1.f)
4237 "Metric shock length calculation failed, 'short_bound' less than 0 meters. Resetting to 0 meters (short_bound = 1)"
4268 shock.
flags = shock_flags;
4282 beam.
shock = & shock;
4283 shock.
beamid = beam_index;
4309 short_bound /= beam_length;
4310 long_bound /= beam_length;
4329 shock.
flags = shock_flags;
4344 beam.
shock = & shock;
4345 shock.
beamid = beam_index;
4359 node_t* swap = axis_node_1;
4360 axis_node_1 = axis_node_2;
4365 node_t *rigidity_node =
nullptr;
4366 node_t *axis_node_closest_to_rigidity_node =
nullptr;
4372 axis_node_closest_to_rigidity_node = ((distance_1 < distance_2)) ? axis_node_1 : axis_node_2;
4381 wheel.
wh_width = axis_vector.length();
4382 axis_vector.normalise();
4383 Ogre::Vector3 rim_ray_vector = axis_vector.perpendicular() * override_rim_radius;
4384 Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / (def.
num_rays * 2)), axis_vector);
4387 for (
unsigned int i = 0; i < def.
num_rays; i++)
4392 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + rim_ray_vector;
4393 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4398 outer_node.
mass = node_mass;
4407 ray_point = axis_node_2->
RelPosition + rim_ray_vector;
4408 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
4413 inner_node.
mass = node_mass;
4426 Ogre::Vector3 tyre_ray_vector = axis_vector.perpendicular() * override_tire_radius;
4427 Ogre::Quaternion& tyre_ray_rotator = rim_ray_rotator;
4428 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4431 for (
unsigned int i = 0; i < def.
num_rays; i++)
4435 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + tyre_ray_vector;
4436 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4440 outer_node.
mass = node_mass;
4451 ray_point = axis_node_2->
RelPosition + tyre_ray_vector;
4452 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
4456 inner_node.
mass = node_mass;
4467 wheel.
wh_nodes[i * 2] = & outer_node;
4468 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
4485 for (
unsigned int i = 0; i < def.
num_rays; i++)
4490 unsigned int rim_outer_node_index = base_node_index + (i * 2);
4500 unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % def.
num_rays) * 2);
4512 for (
unsigned int i = 0; i < def.
num_rays; i++)
4514 int rim_node_index = base_node_index + i*2;
4515 int tyre_node_index = base_node_index + i*2 + def.
num_rays*2;
4520 int tyre_base_index = (i == 0) ? tyre_node_index + (def.
num_rays * 2) : tyre_node_index;
4529 int index = (i == 0) ? tyre_node_index + (def.
num_rays * 2) - 1 : tyre_node_index - 1;
4538 int rimnode = rim_node_index;
4546 if (rigidity_node !=
nullptr)
4548 if (axis_node_closest_to_rigidity_node == axis_node_1)
4550 axis_node_closest_to_rigidity_node = &
m_actor->
ar_nodes[base_node_index+i*2+rays*2];
4553 axis_node_closest_to_rigidity_node = &
m_actor->
ar_nodes[base_node_index+i*2+1+rays*2];
4555 unsigned int beam_index =
AddWheelBeam(rigidity_node, axis_node_closest_to_rigidity_node, tyre_spring, tyre_damp, def.
beam_defaults);
4564 float support_beams_short_bound = 1.0f - ((override_rim_radius / override_tire_radius) * 0.95f);
4566 for (
unsigned int i=0; i<def.
num_rays; i++)
4569 unsigned int tirenode = base_node_index + i*2 + def.
num_rays*2;
4570 unsigned int beam_index;
4611 override_rim_radius,
4628 if (def_node_1 == def_node_2)
4630 throw Exception(
"Wheel axis nodes must not be set to single node!");
4636 out_node_1 = def_node_2;
4637 out_node_2 = def_node_1;
4641 out_node_1 = def_node_1;
4642 out_node_2 = def_node_2;
4650 node_t* axis_node_1 =
nullptr;
4651 node_t* axis_node_2 =
nullptr;
4716 node_t* axis_node_1 =
nullptr;
4717 node_t* axis_node_2 =
nullptr;
4753 float tyre_spring = def.
spring;
4754 float tyre_damp = def.
damping;
4796 unsigned int num_rays,
4798 Ogre::String mesh_name,
4799 Ogre::String mesh_rg,
4800 Ogre::String material_name,
4801 Ogre::String material_rg,
4832 catch (Ogre::Exception& e)
4841 unsigned int num_rays,
4844 node_t *reference_arm_node,
4845 unsigned int reserve_nodes,
4846 unsigned int reserve_beams,
4850 std::shared_ptr<RigDef::NodeDefaults> node_defaults,
4859 float axis_length = axis_vector.length();
4860 axis_vector.normalise();
4869 wheel.
wh_width = (wheel_width < 0) ? axis_length : wheel_width;
4885 Ogre::Vector3 ray_vector = axis_vector.perpendicular() * wheel_radius;
4886 Ogre::Quaternion ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.0 / (num_rays * 2)), axis_vector);
4888 for (
unsigned int i = 0; i < num_rays; i++)
4891 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + ray_vector;
4893 ray_vector = ray_rotator * ray_vector;
4896 InitNode(outer_node, ray_point, node_defaults);
4897 outer_node.
mass = wheel_mass / (2.f * num_rays);
4906 ray_point = axis_node_2->
RelPosition + ray_vector;
4908 ray_vector = ray_rotator * ray_vector;
4911 InitNode(inner_node, ray_point, node_defaults);
4912 inner_node.
mass = wheel_mass / (2.f * num_rays);
4921 wheel.
wh_nodes[i * 2] = & outer_node;
4922 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
4928 unsigned int options = (defaults->options | node_def.
options);
4938 unsigned int num_rays,
4946 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
4952 bool rigidity_beam_side_1 =
false;
4953 node_t *rigidity_node =
nullptr;
4959 rigidity_beam_side_1 = distance_1 < distance_2;
4962 for (
unsigned int i = 0; i < num_rays; i++)
4965 unsigned int outer_ring_node_index = base_node_index + (i * 2);
4969 AddWheelBeam(axis_node_1, outer_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4970 AddWheelBeam(axis_node_2, inner_ring_node, tyre_spring, tyre_damping, beam_defaults, 0.66f, max_extension);
4971 AddWheelBeam(axis_node_2, outer_ring_node, tyre_spring, tyre_damping, beam_defaults);
4972 AddWheelBeam(axis_node_1, inner_ring_node, tyre_spring, tyre_damping, beam_defaults);
4975 unsigned int next_outer_ring_node_index = base_node_index + (((i + 1) % num_rays) * 2);
4979 AddWheelBeam(outer_ring_node, inner_ring_node, rim_spring, rim_damping, beam_defaults);
4980 AddWheelBeam(outer_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4981 AddWheelBeam(inner_ring_node, next_inner_ring_node, rim_spring, rim_damping, beam_defaults);
4982 AddWheelBeam(inner_ring_node, next_outer_ring_node, rim_spring, rim_damping, beam_defaults);
4985 if (rigidity_node !=
nullptr)
4987 node_t *target_node = (rigidity_beam_side_1) ? outer_ring_node : inner_ring_node;
4988 unsigned int beam_index =
AddWheelBeam(rigidity_node, target_node, tyre_spring, tyre_damping, beam_defaults, -1.f, -1.f,
BEAM_VIRTUAL);
4998 node_t* axis_node_1 =
nullptr;
4999 node_t* axis_node_2 =
nullptr;
5069 node_t* axis_node_1 =
nullptr;
5070 node_t* axis_node_2 =
nullptr;
5076 bool rigidity_beam_side_1 =
false;
5082 rigidity_beam_side_1 = distance_1 < distance_2;
5092 axis_vector.normalise();
5093 Ogre::Vector3 rim_ray_vector = Ogre::Vector3(0, override_rim_radius, 0);
5094 Ogre::Quaternion rim_ray_rotator = Ogre::Quaternion(Ogre::Degree(-360.f / wheel_2_def.
num_rays), axis_vector);
5097 wheel.
wh_width = axis_vector.length();
5100 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5102 float node_mass = wheel_2_def.
mass / (4.f * wheel_2_def.
num_rays);
5105 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + rim_ray_vector;
5109 outer_node.
mass = node_mass;
5117 ray_point = axis_node_2->
RelPosition + rim_ray_vector;
5121 inner_node.
mass = node_mass;
5132 rim_ray_vector = rim_ray_rotator * rim_ray_vector;
5135 Ogre::Vector3 tyre_ray_vector = Ogre::Vector3(0, override_tire_radius, 0);
5136 Ogre::Quaternion tyre_ray_rotator = Ogre::Quaternion(Ogre::Degree(-180.f / wheel_2_def.
num_rays), axis_vector);
5137 tyre_ray_vector = tyre_ray_rotator * tyre_ray_vector;
5140 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5143 Ogre::Vector3 ray_point = axis_node_1->
RelPosition + tyre_ray_vector;
5147 outer_node.
mass = (0.67f * wheel_2_def.
mass) / (2.f * wheel_2_def.
num_rays);
5157 ray_point = axis_node_2->
RelPosition + tyre_ray_vector;
5161 inner_node.
mass = (0.33f * wheel_2_def.
mass) / (2.f * wheel_2_def.
num_rays);
5171 wheel.
wh_nodes[i * 2] = & outer_node;
5172 wheel.
wh_nodes[(i * 2) + 1] = & inner_node;
5174 tyre_ray_vector = rim_ray_rotator * tyre_ray_vector;
5192 for (
unsigned int i = 0; i < wheel_2_def.
num_rays; i++)
5197 unsigned int rim_outer_node_index = base_node_index + (i * 2);
5201 unsigned int beam_index;
5202 beam_index =
AddWheelRimBeam(wheel_2_def, axis_node_1, rim_outer_node);
5204 beam_index =
AddWheelRimBeam(wheel_2_def, axis_node_2, rim_inner_node);
5210 unsigned int rim_next_outer_node_index = base_node_index + (((i + 1) % wheel_2_def.
num_rays) * 2);
5226 (rigidity_beam_side_1) ? rim_outer_node : rim_inner_node
5233 unsigned int tyre_node_index = rim_outer_node_index + (2 * wheel_2_def.
num_rays);
5236 unsigned int tyre_next_node_index = rim_next_outer_node_index + (2 * wheel_2_def.
num_rays);
5241 AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_outer_node);
5242 AddTyreBeam(wheel_2_def, tyre_outer_node, tyre_next_inner_node);
5243 AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_outer_node);
5244 AddTyreBeam(wheel_2_def, tyre_inner_node, tyre_next_inner_node);
5246 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_outer_node);
5247 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_outer_node);
5248 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_inner_node);
5249 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_inner_node);
5251 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_inner_node);
5252 AddTyreBeam(wheel_2_def, tyre_outer_node, rim_next_inner_node);
5253 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_outer_node);
5254 AddTyreBeam(wheel_2_def, tyre_inner_node, rim_next_outer_node);
5256 AddTyreBeam(wheel_2_def, axis_node_1, tyre_outer_node);
5257 AddTyreBeam(wheel_2_def, axis_node_2, tyre_inner_node);
5294 override_rim_radius / override_tire_radius
5303 unsigned int num_rays,
5304 Ogre::String
const& face_material_name,
5305 Ogre::String
const& face_material_rg,
5306 Ogre::String
const& band_material_name,
5307 Ogre::String
const& band_material_rg,
5320 const std::string wheel_mesh_name = this->
ComposeName(
"mesh @ wheel*", wheel_index);
5326 static_cast<NodeNum_t>(node_base_index),
5328 face_material_name, face_material_rg,
5329 band_material_name, band_material_rg,
5334 const std::string instance_name = this->
ComposeName(
"entity @ wheel*", wheel_index);
5342 catch (Ogre::Exception& e)
5356 std::string rim_mesh_name,
5357 std::string rim_mesh_rg,
5358 std::string tire_mesh_name,
5359 std::string tire_mesh_rg)
5377 int num_nodes = num_rays * 4;
5378 std::vector<unsigned int> node_indices;
5379 node_indices.reserve(num_nodes);
5380 for (
int i = 0; i < num_nodes; ++i)
5382 node_indices.push_back( node_base_index + i );
5384 std::vector<ForvertTempData> forverts;
5393 Ogre::Vector3(0.5f, 0.5f, 0.f),
5394 Ogre::Vector3(0.f, 0.f, 0.f),
5401 if (flexbody ==
nullptr)
5408 catch (Ogre::Exception& e)
5411 "Failed to create flexbodywheel visuals '" + tire_mesh_name +
"', reason:" + e.getDescription());
5420 std::shared_ptr<RigDef::BeamDefaults> beam_defaults,
5421 float max_contraction,
5422 float max_extension,
5431 if (max_contraction > 0.f)
5492 if (force < 1.f || force > 20.f)
5494 std::stringstream msg;
5495 msg <<
"Clamping 'regulating_force' value '" << force <<
"' to allowed range <1 - 20>";
5497 force = (force < 1.f) ? 1.f : 20.f;
5509 if (pulse <= 1.0f || pulse >= 2000.0f)
5525 if (force < 1.f || force > 20.f)
5527 std::stringstream msg;
5528 msg <<
"Clamping 'regulating_force' value '" << force <<
"' to allowed range <1 - 20>";
5530 force = (force < 1.f) ? 1.f : 20.f;
5541 if (pulse <= 1.0f || pulse >= 2000.0f)
5572 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);
5649 std::stringstream msg;
5650 msg <<
"Failed to retrieve required node: " << node_ref.
ToString();
5692 beam.
k = def.
defaults->GetScaledSpringiness();
5693 beam.
d = def.
defaults->GetScaledDamping();
5701 float beam_strength = def.
defaults->GetScaledBreakingThreshold();
5824 if (beam_defaults->_is_user_defined)
5826 default_deform = beam_defaults->deformation_threshold;
5827 if (!beam_defaults->_enable_advanced_deformation && default_deform <
BEAM_DEFORM)
5832 if (beam_defaults->_is_plastic_deform_coef_user_defined && beam_defaults->plastic_deform_coef >=
BEAM_PLASTIC_COEF_DEFAULT)
5839 if (default_deform < beam_creak)
5841 default_deform = beam_creak;
5844 float deformation_threshold = default_deform * beam_defaults->scale.deformation_threshold_constant;
5853 std::string material_name = material_override;
5854 if (material_name ==
"")
5858 material_name =
"tracks/Chrome";
5862 material_name = beam_defaults->beam_material_name;
5875 entity->setMaterial(mat);
5878 beamx.
rod_diameter = beam_defaults->visual_beam_diameter;
5889 beamx.
rod_scenenode->setScale(beam_defaults->visual_beam_diameter, -1, beam_defaults->visual_beam_diameter);
5893 catch (Ogre::Exception& e)
5902 beam.
L = beam_length;
5903 beam.
refL = beam_length;
5926 txt <<
": " << text;
5956 bool is_imported = node_ref.GetImportState_IsValid();
5957 bool is_named = (is_imported ? node_ref.GetImportState_IsResolvedNamed() : node_ref.GetRegularState_IsNamed());
5966 std::stringstream msg;
5967 msg <<
"Failed to resolve node-ref (node not found):" << node_ref.
ToString();
5978 std::stringstream msg;
6004 if (node ==
nullptr)
6006 std::stringstream msg;
6007 msg <<
"Required node not found: " << node_ref.
ToString();
6017 std::stringstream msg;
6018 msg <<
"Attempt to add node with 'INVALID' flag: " <<
id.ToString() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
6023 if (
id.IsTypeNamed())
6026 auto insert_result =
m_named_nodes.insert(std::make_pair(
id.
Str(), new_index));
6027 if (! insert_result.second)
6029 std::stringstream msg;
6030 msg <<
"Ignoring named node! Duplicate name: " <<
id.Str() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
6040 if (
id.IsTypeNumbered())
6044 std::stringstream msg;
6045 msg <<
"Duplicate node number, previous definition will be overriden! - " <<
id.ToString() <<
" (number of nodes at this point: " <<
m_actor->
ar_num_nodes <<
")";
6054 throw Exception(
"Invalid Node::Id without type flags!");
6203 if (exhaust.
smoker ==
nullptr)
6211 exhaust.
smoker->setMaterialName(mat->getName(), mat->getGroup());
6243 for (
unsigned int i = 0; i < 8; i++)
6264 Ogre::Vector3
const & position,
6265 std::shared_ptr<RigDef::NodeDefaults> node_defaults
6282 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(def.
material_name);
6289 std::stringstream msg;
6290 msg <<
"Material '" << def.
material_name <<
"' defined in section 'globals' not found. Trying material 'tracks/transred'";
6306 std::stringstream msg;
6307 msg <<
"Axle limit (" <<
MAX_WHEELS/2 <<
") exceeded";
6318 std::stringstream msg;
6330 std::stringstream msg;
6343 std::stringstream msg;
6355 std::stringstream msg;
6356 msg <<
"Cab limit (" <<
MAX_CABS <<
") exceeded";
6367 std::stringstream msg;
6379 std::stringstream msg;
6391 std::stringstream msg;
6577 Ogre::String index_str =
TOSTRING(i+1);
6645 for (
auto& def:
module->materialflarebindings)
6647 if (def.material_name == material_name)
6660 for (
auto& def:
module->videocameras)
6662 if (def.material_name == material_name)
6680 return lookup_res->second.material;
6686 if (mat_lookup_name ==
"mirror")
6691 static int mirror_counter = 0;
6692 const std::string new_mat_name = this->
ComposeName(
"RenderMaterial", mirror_counter);
6694 lookup_entry.
material = Ogre::MaterialManager::getSingleton().getByName(
"mirror")->clone(new_mat_name,
true, mat_lookup_rg);
6702 if (videocam_def !=
nullptr)
6704 Ogre::MaterialPtr video_mat_shared;
6708 video_mat_shared = found_managedmat->second;
6712 video_mat_shared = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name);
6715 if (video_mat_shared)
6719 lookup_entry.
material = video_mat_shared->clone(video_mat_name,
true, mat_lookup_rg);
6725 std::stringstream msg;
6726 msg <<
"VideoCamera material '" << mat_lookup_name <<
"' not found! Ignoring videocamera.";
6733 if (mat_flare_def !=
nullptr)
6743 auto skin_res = skin_def->replace_materials.find(mat_lookup_name);
6744 if (skin_res != skin_def->replace_materials.end())
6746 Ogre::MaterialPtr skin_mat = Ogre::MaterialManager::getSingleton().getByName(
6750 lookup_entry.
material = skin_mat->clone(this->
ComposeName(skin_mat->getName()),
true, mat_lookup_rg);
6756 std::stringstream buf;
6760 <<
"')! Ignoring it...";
6771 lookup_entry.
material = mmat_res->second;
6776 Ogre::MaterialPtr orig_mat = Ogre::MaterialManager::getSingleton().getByName(mat_lookup_name, mat_lookup_rg);
6779 std::stringstream buf;
6780 buf <<
"Material doesn't exist:" << mat_lookup_name;
6782 return Ogre::MaterialPtr();
6785 lookup_entry.
material = orig_mat->clone(this->
ComposeName(orig_mat->getName()),
true, mat_lookup_rg);
6797 for (
auto& technique: lookup_entry.
material->getTechniques())
6799 for (
auto& pass: technique->getPasses())
6801 for (
auto& tex_unit: pass->getTextureUnitStates())
6804 if (tex_unit->getTextureName() ==
"dashtexture")
6808 ROR_ASSERT(dash_tex &&
"could not find renderdash's render texture");
6809 tex_unit->setTexture(dash_tex);
6812 else if (Ogre::StringUtil::startsWith(tex_unit->getTextureName(),
"RTTTexture"))
6814 int rtt_index = std::stoi(tex_unit->getTextureName().substr(std::string(
"RTTTexture").length()));
6818 LOG(fmt::format(
"[RoR|DashBoard] Swapping placeholder '{}' for '{}'", tex_unit->getTextureName(), texname));
6819 const Ogre::TexturePtr dash_tex = Ogre::TextureManager::getSingleton().getByName(texname);
6820 tex_unit->setTexture(dash_tex);
6825 fmt::format(
"Invalid dashboard RTT texture {} in material '{}', number of available RTTTextures: {}",
6832 const size_t num_frames = tex_unit->getNumFrames();
6833 for (
size_t i = 0; i < num_frames; ++i)
6842 Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().getByName(
6850 tex = Ogre::TextureManager::getSingleton().create(
6853 tex_unit->_setTexturePtr(tex, i);
6857 tex_unit->setFrameTextureName(query->second, (
unsigned int)i);
6869 catch (Ogre::Exception& e)
6871 std::stringstream msg;
6872 msg <<
"Exception while customizing material \"" << mat_lookup_name <<
"\", message: " << e.getFullDescription();
6875 return Ogre::MaterialPtr();
6882 static unsigned int simple_mat_counter = 0;
6884 newmat->getTechnique(0)->getPass(0)->setAmbient(color);
6920 size_t num_sub_entities = ent->getNumSubEntities();
6921 for (
size_t i = 0; i < num_sub_entities; i++)
6923 Ogre::SubEntity* subent = ent->getSubEntity(i);
6924 subent->setMaterial(mat);
6931 size_t subent_max = ent->getNumSubEntities();
6932 for (
size_t i = 0; i < subent_max; ++i)
6934 Ogre::SubEntity* subent = ent->getSubEntity(i);
6936 if (subent->getMaterial())
6941 subent->setMaterial(own_mat);
6955 if (entry.second.material_flare_def !=
nullptr)
6958 entry.second.material_flare_def->flare_number, entry.second.material);
6963 entry.second.material, entry.second.mirror_prop_type, entry.second.mirror_prop_scenenode);
6965 else if (entry.second.video_camera_def !=
nullptr)
6982 for (
auto& gs:
module->guisettings)
6984 if (gs.key == "dashboard")
6986 m_actor->ar_dashboard->loadDashBoard(gs.value, LOADDASHBOARD_SCREEN_HUD, nullptr);
6988 else if (gs.key ==
"texturedashboard")
7008 RTTLayer* defaultdash_rtt_layer =
nullptr;
7011 switch (m_actor->ar_driveable)
7016 m_actor->ar_dashboard->setVisible(
false);
7020 m_actor->ar_dashboard->setVisible(
false);
7026 if (m_actor->ar_guisettings_help_material !=
"")
7030 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(m_actor->ar_guisettings_help_material, m_custom_resource_group);
7031 m_actor->m_gfx_actor->m_help_mat = mat;
7033 mat->getNumTechniques() > 0 &&
7034 mat->getTechnique(0)->getNumPasses() > 0 &&
7035 mat->getTechnique(0)->getPass(0)->getNumTextureUnitStates() > 0 &&
7036 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getNumFrames() > 0)
7038 m_actor->m_gfx_actor->m_help_tex =
7039 Ogre::TextureManager::getSingleton().getByName(
7040 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->getFrameTextureName(0), m_custom_resource_group);
7043 catch (Ogre::Exception& e)
7045 this->AddMessage(Message::TYPE_ERROR,
7046 "Failed to load `help` material '" + m_actor->ar_guisettings_help_material +
"', message:" + e.getFullDescription());
7050 m_actor->ar_managed_materials = m_managed_materials;
7055 const float eps = 0.001f;
7058 Ogre::Plane pl = Ogre::Plane((ax1 - ax2).normalisedCopy(), 0);
7064 float a1len = a1.normalise();
7065 float a2len = a2.normalise();
7066 float a3len = a3.normalise();
7067 float a4len = a4.normalise();
7068 if ((std::max(a1len, a3len) / std::min(a1len, a3len) > 1.f + eps) ||
7069 (std::max(a2len, a4len) / std::min(a2len, a4len) > 1.f + eps))
7071 Ogre::String msg = Ogre::StringUtil::format(
"Off-centered axis on base plate of rotator %d",
id);
7079 float b1len = b1.normalise();
7080 float b2len = b2.normalise();
7081 float b3len = b3.normalise();
7082 float b4len = b4.normalise();
7083 if ((std::max(b1len, b3len) / std::min(b1len, b3len) > 1.f + eps) ||
7084 (std::max(b2len, b4len) / std::min(b2len, b4len) > 1.f + eps))
7086 Ogre::String msg = Ogre::StringUtil::format(
"Off-centered axis on rotating plate of rotator %d",
id);
7090 float rot1 = a1.dotProduct(b1);
7091 float rot2 = a2.dotProduct(b2);
7092 float rot3 = a3.dotProduct(b3);
7093 float rot4 = a4.dotProduct(b4);
7094 if ((std::max(rot1, rot2) / std::min(rot1, rot2) > 1.f + eps) ||
7095 (std::max(rot2, rot3) / std::min(rot2, rot3) > 1.f + eps) ||
7096 (std::max(rot3, rot4) / std::min(rot3, rot4) > 1.f + eps) ||
7097 (std::max(rot4, rot1) / std::min(rot4, rot1) > 1.f + eps))
7099 Ogre::String msg = Ogre::StringUtil::format(
"Misaligned plates on rotator %d",
id);
7108 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().create(
7109 "VideoCamDebugMat-" +
TOSTRING(
counter), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
7111 mat->getTechnique(0)->getPass(0)->createTextureUnitState();
7112 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_ANISOTROPIC);
7113 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureAnisotropy(3);
7114 mat->setLightingEnabled(
false);
7115 mat->setReceiveShadows(
false);
7118 mo->begin(mat->getName(), Ogre::RenderOperation::OT_LINE_LIST);
7119 Ogre::ColourValue pos_mark_col(1.f, 0.82f, 0.26f);
7120 Ogre::ColourValue dir_mark_col(0.f, 1.f, 1.f);
7121 const float pos_mark_len = 0.8f;
7122 const float dir_mark_len = 4.f;
7124 mo->position(pos_mark_len,0,0);
7125 mo->colour(pos_mark_col);
7126 mo->position(-pos_mark_len,0,0);
7127 mo->colour(pos_mark_col);
7129 mo->position(0,pos_mark_len,0);
7130 mo->colour(pos_mark_col);
7131 mo->position(0,-pos_mark_len,0);
7132 mo->colour(pos_mark_col);
7134 mo->position(0,0,pos_mark_len);
7135 mo->colour(pos_mark_col);
7136 mo->position(0,0,0);
7137 mo->colour(pos_mark_col);
7139 mo->position(0,0,-dir_mark_len);
7140 mo->colour(dir_mark_col);
7141 mo->position(0,0,0);
7142 mo->colour(dir_mark_col);
7176 float rotation_z = def->
rotation.z + 180;
7180 rotation_z += 180.0f;
7183 = Ogre::Quaternion(Ogre::Degree(rotation_z), Ogre::Vector3::UNIT_Z)
7184 * Ogre::Quaternion(Ogre::Degree(def->
rotation.y), Ogre::Vector3::UNIT_Y)
7185 * Ogre::Quaternion(Ogre::Degree(def->
rotation.x), Ogre::Vector3::UNIT_X);
7215 vcam.
vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7217 Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
7223 Ogre::TU_RENDERTARGET);
7242 vcam.
vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(
false);
7248 vp->setClearEveryFrame(
true);
7252 vp->setOverlaysEnabled(
false);
7258 vcam.
vcam_material->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureUScale(-1);
7264 vp->setClearEveryFrame(
true);
7268 vp->setOverlaysEnabled(
false);
7282 catch (std::exception & ex)
7295 static int mprop_counter = 0;
7318 vcam.
vcam_render_tex = Ogre::TextureManager::getSingleton().createManual(
7319 this->
ComposeName(
"texture @ mirror", mprop_counter)
7326 , Ogre::TU_RENDERTARGET);
7340 v->setClearEveryFrame(
true);
7342 v->setOverlaysEnabled(
false);
7347 vcam.
vcam_material->getTechnique(0)->getPass(0)->setLightingEnabled(
false);
7352 catch (std::exception & ex)
7367 catch (Ogre::Exception& ogre_e)
7372 <<
") " << ogre_e.getFullDescription();
7376 catch (std::exception& std_e)
7391 Ogre::NameValuePairList params;
7393 params[
"templateName"] = template_name;
7396 name, Ogre::ParticleSystemFactory::FACTORY_TYPE_NAME, ¶ms);
7397 Ogre::ParticleSystem* psys =
static_cast<Ogre::ParticleSystem*
>(obj);
7401 for (
size_t i = 0; i < psys->getNumEmitters(); i++)
7403 psys->getEmitter(i)->setEnabled(
false);
7425 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(
m_cab_material_name);
7434 char transmatname[256];
7435 static int trans_counter = 0;
7437 Ogre::MaterialPtr transmat=mat->clone(transmatname);
7438 if (mat->getTechnique(0)->getNumPasses()>1)
7440 transmat->getTechnique(0)->removePass(1);
7442 transmat->getTechnique(0)->getPass(0)->setAlphaRejectSettings(Ogre::CMPF_LESS_EQUAL, 128);
7443 transmat->getTechnique(0)->getPass(0)->setDepthWriteEnabled(
false);
7444 if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7446 transmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::TFO_NONE);
7448 transmat->compile();
7452 char backmatname[256];
7453 static int back_counter = 0;
7455 Ogre::MaterialPtr backmat=mat->clone(backmatname);
7456 if (mat->getTechnique(0)->getNumPasses()>1)
7458 backmat->getTechnique(0)->removePass(1);
7460 if (transmat->getTechnique(0)->getPass(0)->getNumTextureUnitStates()>0)
7462 backmat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setColourOperationEx(
7466 Ogre::ColourValue(0,0,0),
7467 Ogre::ColourValue(0,0,0)
7472 backmat->setReceiveShadows(
false);
7478 char cab_material_name_cstr[1000] = {};
7480 std::string mesh_name = this->
ComposeName(
"mesh @ cab");
7488 cab_material_name_cstr,
7495 Ogre::Entity *ec =
nullptr;
7502 cab_scene_node->attachObject(ec);
7515 catch (Ogre::Exception& e)
7533 Ogre::Technique* tech = m->getTechnique(0);
7536 Ogre::Pass* p = tech->getPass(0);
7541 p->setSelfIllumination(Ogre::ColourValue::ZERO);
7571 Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton().load(
7577 tus->setTexture(tex);
7595 for (
auto& gs:
module->guisettings)
7597 if (gs.key == "texturedashboard")
7599 RTTLayer* rttLayer = App::GetGuiManager()->GetRttLayerManager().CreateOrReuseRttLayer();
7600 rttLayer->setTextureSize(MyGUI::IntSize(1024, 1024));
7602 rttLayer->createRttTexture();
7618 Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName(
"renderdash",
m_custom_resource_group);
7619 ROR_ASSERT(mat &&
"could not find 'renderdash' material");
7630 ROR_ASSERT(renderdash_tex &&
"failed to find 'renderdash' texture");
7632 mat->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTexture(renderdash_tex);
Ogre::ManualObject * CreateVideocameraDebugMesh()
System integration layer; inspired by OgreBites::ApplicationContext.
Central state/object manager and communications hub.
#define ROR_ASSERT(_EXPR)
void LOG(const char *msg)
Legacy alias - formerly a macro.
#define BITMASK_SET_0(VAR, FLAGS)
#define BITMASK_IS_1(VAR, FLAGS)
#define BITMASK_IS_0(VAR, FLAGS)
#define BITMASK_SET_1(VAR, FLAGS)
A database of user-installed content alias 'mods' (vehicles, terrains...)
Game state manager and message-queue provider.
Manager for all visuals belonging to a single actor.
static const int MAX_CABS
maximum number of cabs per actor
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
static const int MAX_CAMERAS
maximum number of cameras per actor
static const int MAX_AEROENGINES
maximum number of aero engines per actor
static const int MAX_WHEELS
maximum number of wheels per actor
static const int MAX_SUBMESHES
maximum number of submeshes per actor
static const int MAX_COMMANDS
maximum number of commands per actor
static const int MAX_SOUNDSCRIPTS_PER_TRUCK
maximum number of soundsscripts per actor
static const int MAX_TEXCOORDS
maximum number of texture coordinates per actor
static const int MAX_CAMERARAIL
maximum number of camera rail points
static const int MAX_SCREWPROPS
maximum number of boat screws per actor
#define SOUND_START(_ACTOR_, _TRIG_)
#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
void setCastShadows(bool b)
Ogre::SceneNode * GetSceneNode()
void setMaterialName(Ogre::String m)
Ogre::Entity * getEntity()
Abstract node ID (numbered or named) Node name is always available.
Legacy parser resolved references on-the-fly and the condition to check named nodes was "are there an...
bool IsValidAnyState() const
std::string ToString() const
std::string const & Str() const
bool alb_mode
Anti-lock brake state; Enabled? {1/0}.
float m_odometer_user
GUI state.
int m_num_command_beams
TODO: Remove! Spawner context only; likely unused feature.
float ar_collision_range
Physics attr.
std::vector< Ogre::AxisAlignedBox > ar_predicted_coll_bounding_boxes
std::vector< float > ar_minimass
minimum node mass in Kg - can be scaled in-game via NBUtil
TransferCase * m_transfer_case
Physics.
float ar_guisettings_speedo_max_kph
float ar_dry_mass
User-defined (editable via NBUtil); from 'globals' arg#1 - default for all nodes.
int ar_airbrake_intensity
Physics state; values 0-5.
int m_proped_wheel_pairs[MAX_WHEELS]
Physics attr; For inter-differential locking.
NodeNum_t ar_camera_node_dir[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; back node.
collcab_rate_t ar_intra_collcabrate[MAX_CABS]
std::vector< float > ar_nodes_override_loadweights
'nodes': 'l' flag and number.
std::vector< bool > ar_beams_invisible
Used only by the exporter (for rendering, invisible beams simply get no mesh).
std::vector< ropable_t > ar_ropables
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
wheel_t ar_wheels[MAX_WHEELS]
std::vector< rope_t > ar_ropes
DashBoardManagerPtr ar_dashboard
Gfx state; Dashboard manager (HUD element manager)
float m_odometer_total
GUI state.
std::vector< wheeldetacher_t > ar_wheeldetachers
bool ar_camera_node_roll_inv[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; indicates roll node is right instead of left.
int ar_buoycabs[MAX_CABS]
std::vector< BitMask_t > ar_nodes_options
merged options from 'nodes' and 'set_node_defaults'
int m_num_wheel_diffs
Physics attr.
std::vector< bool > ar_beams_user_defined
True for 'beams', false for wheels/cinecam/hooknode/wings/rotators etc...
int m_num_proped_wheels
Physics attr, filled at spawn - Number of propelled wheels.
std::vector< Ogre::SceneNode * > m_deletion_scene_nodes
For unloading vehicle; filled at spawn.
std::vector< tie_t > ar_ties
int m_num_axle_diffs
Physics attr.
float ar_posnode_spawn_height
ground_model_t * ar_submesh_ground_model
std::vector< SlideNode > m_slidenodes
all the SlideNodes available on this actor
int * ar_nodes_id
Number in truck file, -1 for nodes generated by wheels/cinecam.
NodeNum_t ar_camera_node_roll[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; left node.
Differential * m_axle_diffs[1+MAX_WHEELS/2]
Physics.
ScrewpropPtr ar_screwprops[MAX_SCREWPROPS]
bool m_disable_smoke
Stops/starts smoke particles (i.e. exhausts, turbojets).
NodeNum_t ar_main_camera_node_pos
Sim attr; ar_camera_node_pos[0] >= 0 ? ar_camera_node_pos[0] : 0.
bool ar_is_police
Gfx/sfx attr.
std::vector< Airbrake * > ar_airbrakes
bool m_beam_break_debug_enabled
Logging state.
std::vector< float > ar_nodes_default_loadweights
'set_node_defaults': load weight.
NodeNum_t ar_camera_rail[MAX_CAMERARAIL]
Nodes defining camera-movement spline.
int ar_buoycab_types[MAX_CABS]
float m_fusealge_width
Physics attr; defined in truckfile.
Airfoil * m_fusealge_airfoil
Physics attr; defined in truckfile.
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...
soundsource_t ar_soundsources[MAX_SOUNDSCRIPTS_PER_TRUCK]
node_t * m_fusealge_front
Physics attr; defined in truckfile.
std::vector< flare_t > ar_flares
std::vector< Ogre::Entity * > m_deletion_entities
For unloading vehicle; filled at spawn.
std::unique_ptr< Buoyance > m_buoyance
bool alb_nodash
Anti-lock brake attribute: Hide the dashboard indicator?
bool sl_enabled
Speed limiter;.
ExtCameraMode ar_extern_camera_mode
float ar_load_mass
User-defined (editable via NBUtil); from 'globals' arg#2 - only applies to nodes with 'l' flag.
node_t * m_fusealge_back
Physics attr; defined in truckfile.
NodeNum_t ar_exhaust_dir_node
Old-format exhaust (one per vehicle) backwards direction node.
int ar_masscount
Calculated; Number of nodes loaded with l option.
PointColDetector * m_inter_point_col_detector
Physics.
BitMask_t m_flaregroups_no_import
RoRnet::Lightmask.
std::vector< RailGroup * > m_railgroups
all the available RailGroups for this actor
float m_handbrake_force
Physics attr; defined in truckfile.
NodeNum_t ar_extern_camera_node
Ogre::Vector3 ar_origin
Physics state; base position for softbody nodes.
float ar_guisettings_shifter_anim_time
float ar_brake_force
Physics attr; filled at spawn.
std::unique_ptr< GfxActor > m_gfx_actor
NodeNum_t ar_exhaust_pos_node
Old-format exhaust (one per vehicle) emitter node.
AeroEnginePtr ar_aeroengines[MAX_AEROENGINES]
std::string getTruckFileName()
int ar_num_shocks
Number of shock absorbers.
float ar_total_mass
Calculated; total mass in Kg.
float ar_anim_shift_timer
For 'animator' with flag 'shifter'.
float alb_ratio
Anti-lock brake attribute: Regulating force.
float cc_target_speed_lower_limit
Cruise Control.
std::vector< authorinfo_t > authors
bool m_beam_deform_debug_enabled
Logging state.
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
bool alb_notoggle
Anti-lock brake attribute: Disable in-game toggle?
std::vector< PropAnimKeyState > m_prop_anim_key_states
bool m_has_axles_section
Temporary (legacy parsing helper) until central diffs are implemented.
bool ar_minimass_skip_loaded_nodes
std::string * ar_nodes_name
Name in truck file, only if defined with 'nodes2'.
float cc_target_rpm
Cruise Control.
NodeNum_t ar_camera_node_pos[MAX_CAMERAS]
Physics attr; 'camera' = frame of reference; origin node.
int ar_num_cinecams
Sim attr;.
GfxFlaresMode m_flares_mode
Snapshot of cvar 'gfx_flares_mode' on spawn.
collcab_rate_t ar_inter_collcabrate[MAX_CABS]
TyrePressure & getTyrePressure()
bool cc_mode
Cruise Control.
Differential * m_wheel_diffs[MAX_WHEELS/2]
Physics.
bool ar_hide_in_actor_list
Hide in list of spawned actors (available in top menubar). Useful for fixed-place machinery,...
float alb_pulse_time
Anti-lock brake attribute;.
Skidmark * m_skid_trails[MAX_WHEELS *2]
float alb_minspeed
Anti-lock brake attribute;.
Ogre::Quaternion ar_main_camera_dir_corr
Sim attr;.
std::string ar_guisettings_speedo_material
Used on 'renderdash'.
bool m_has_command_beams
Physics attr;.
std::vector< std::string > m_description
std::string ar_guisettings_tacho_material
Used on 'renderdash'.
VehicleAIPtr ar_vehicle_ai
float ar_anim_previous_crank
For 'animator' with flag 'torque'.
std::string ar_guisettings_help_material
Used on 'renderdash'.
std::string getTruckFileResourceGroup()
bool tc_notoggle
Disable in-game toggle?
AutopilotPtr ar_autopilot
float tc_ratio
Regulating force.
float alb_timer
Anti-lock brake state;.
int ar_num_contacters
Total number of nodes which can selfcontact cabs.
std::vector< hydrobeam_t > ar_hydros
int ar_nodes_name_top_length
For nicely formatted diagnostic output.
NodeNum_t ar_main_camera_node_dir
Sim attr; ar_camera_node_dir[0] >= 0 ? ar_camera_node_dir[0] : 0.
std::vector< hook_t > ar_hooks
bool ar_collision_relevant
Physics state;.
PointColDetector * m_intra_point_col_detector
Physics.
CacheEntryPtr m_used_skin_entry
Optional, only graphics.
shock_t * ar_shocks
Shock absorbers.
bool tc_nodash
Hide the dashboard indicator?
NodeNum_t ar_cinecam_node[MAX_CAMERAS]
Sim attr; Cine-camera node indexes.
Ogre::Vector3 * ar_nodes_spawn_offsets
Relative positions (incl. Tuning system tweaks) from the definition file, for spawn-like resetting (i...
bool alb_pulse_state
Anti-lock brake state;.
CacheEntryPtrVec m_used_addonpart_entries
Optional, assigned by player via Tuning menu (.tuneup files).
float m_avg_proped_wheel_radius
Physics attr, filled at spawn - Average proped wheel radius.
bool m_trigger_debug_enabled
Logging state.
CacheEntryPtrVec m_used_assetpack_entries
Optional, specified by mod author in truck file via 'assetpacks' section.
int ar_collcabs[MAX_CABS]
bool ar_has_active_shocks
Are there active stabilizer shocks?
int ar_num_contactable_nodes
Total number of nodes which can contact ground or cabs.
TuneupDefPtr m_working_tuneup_def
Each actor gets unique instance, even if loaded from .tuneup file in modcache.
TuneupDefPtr & getWorkingTuneupDef()
bool ar_guisettings_use_engine_max_rpm
float cc_target_speed
Cruise Control.
float sl_speed_limit
Speed limiter;.
ActorType ar_driveable
Sim attr; marks vehicle type and features.
NodeNum_t ar_main_camera_node_roll
Sim attr; ar_camera_node_roll[0] >= 0 ? ar_camera_node_roll[0] : 0.
bool cc_can_brake
Cruise Control.
std::vector< UniqueCommandKeyPair > ar_unique_commandkey_pairs
UI helper for displaying command control keys to user (must be built at spawn).
RoR::CmdKeyInertiaConfig & GetInertiaConfig()
void ProcessAntiLockBrakes(RigDef::AntiLockBrakes &def)
std::map< std::string, Ogre::MaterialPtr > m_managed_materials
void CreateMeshWheelVisuals(WheelID_t wheel_id, NodeNum_t base_node_index, NodeNum_t axis_node_1_index, NodeNum_t axis_node_2_index, unsigned int num_rays, WheelSide side, Ogre::String mesh_name, Ogre::String mesh_rg, Ogre::String material_name, Ogre::String material_rg, float rim_radius)
static void AddSoundSource(ActorPtr const &vehicle, SoundScriptInstancePtr sound_script, NodeNum_t node_index, int type=-2)
void ConfigureAssetPacks(ActorPtr actor)
void ConfigureAddonParts(ActorPtr actor)
static bool CheckSoundScriptLimit(ActorPtr const &vehicle, unsigned int count)
void InitBeam(beam_t &beam, node_t *node_1, node_t *node_2)
void ProcessFlare2(RigDef::Flare2 &def)
RigDef::MaterialFlareBinding * FindFlareBindingForMaterial(std::string const &material_name)
Returns NULL if none found.
unsigned int AddTyreBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
void ProcessScrewprop(RigDef::Screwprop &def)
RTTLayer * m_renderdash_rtt_layer
The built-in 'renderdash' material.
bool CheckTexcoordLimit(unsigned int count)
bool AssignWheelToAxle(int &_out_axle_wheel, node_t *axis_node_1, node_t *axis_node_2)
Finds wheel with given axle nodes and returns it's index.
void ProcessFixedNode(RigDef::Node::Ref node_ref)
void CalculateBeamLength(beam_t &beam)
void SetBeamDeformationThreshold(beam_t &beam, std::shared_ptr< RigDef::BeamDefaults > beam_defaults)
void _ProcessKeyInertia(RigDef::Inertia &inertia, RigDef::Inertia &inertia_defaults, RoR::CmdKeyInertia &contract_key, RoR::CmdKeyInertia &extend_key)
void GetWheelAxisNodes(RigDef::BaseWheel &def, node_t *&out_node_1, node_t *&out_node_2)
void ProcessGlobals(RigDef::Globals &def)
std::vector< CabSubmesh > m_oldstyle_cab_submeshes
int m_airplane_left_light
void ProcessHydro(RigDef::Hydro &def)
void ValidateRotator(int id, int axis1, int axis2, NodeNum_t *nodes1, NodeNum_t *nodes2)
CustomMaterial::MirrorPropType m_curr_mirror_prop_type
node_t & GetAndInitFreeNode(Ogre::Vector3 const &position)
void UpdateCollcabContacterNodes()
void PrepareRenderdashMaterial()
void ProcessRotator2(RigDef::Rotator2 &def)
void ProcessTractionControl(RigDef::TractionControl &def)
static void AddSoundSourceInstance(ActorPtr const &vehicle, Ogre::String const &sound_script_name, int node_index, int type=-2)
void InitNode(node_t &node, Ogre::Vector3 const &position)
void ProcessMeshWheel2(RigDef::MeshWheel2 &def)
void SetBeamSpring(beam_t &beam, float spring)
void ProcessMinimass(RigDef::Minimass &def)
void ProcessEngturbo(RigDef::Engturbo &def)
void CreateWheelSkidmarks(WheelID_t wheel_index)
void ProcessProp(RigDef::Prop &def)
Resource group override is used with addonparts.
bool m_generate_wing_position_lights
node_t * GetNodePointerOrThrow(RigDef::Node::Ref const &node_ref)
void ConfigureSections(Ogre::String const §ionconfig, RigDef::DocumentPtr def)
void BuildAeroEngine(NodeNum_t ref_node_index, NodeNum_t back_node_index, NodeNum_t blade_1_node_index, NodeNum_t blade_2_node_index, NodeNum_t blade_3_node_index, NodeNum_t blade_4_node_index, NodeNum_t couplenode_index, bool is_turboprops, Ogre::String const &airfoil, float power, float pitch)
void ProcessWheelDetacher(RigDef::WheelDetacher &def)
node_t * GetNodePointer(RigDef::Node::Ref const &node_ref)
void ProcessSlidenode(RigDef::SlideNode &def)
void ProcessSoundSource2(RigDef::SoundSource2 &def)
void ProcessExtCamera(RigDef::ExtCamera &def)
void ProcessSoundSource(RigDef::SoundSource &def)
Ogre::ParticleSystem * CreateParticleSystem(std::string const &name, std::string const &template_name)
Ogre::MaterialPtr m_managedmat_placeholder_template
An 'error marker' material (bright magenta) to generate managedmaterial placeholders from.
void SetBeamDamping(beam_t &beam, float damping)
NodeNum_t RegisterNode(RigDef::Node::Id &id)
void ProcessBeam(RigDef::Beam &def)
void SetCurrentKeyword(RigDef::Keyword keyword)
void ProcessRope(RigDef::Rope &def)
void ProcessParticle(RigDef::Particle &def)
unsigned int _SectionWheels2AddBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
void ProcessFlare3(RigDef::Flare3 &def)
std::map< std::string, CustomMaterial > m_material_substitutions
Maps original material names (shared) to their actor-specific substitutes; There's 1 substitute per 1...
void ProcessCruiseControl(RigDef::CruiseControl &def)
void ProcessHook(RigDef::Hook &def)
NodeNum_t GetNodeIndexOrThrow(RigDef::Node::Ref const &id)
void ProcessTurbojet(RigDef::Turbojet &def)
void ProcessExhaust(RigDef::Exhaust &def)
void ProcessFlexbody(RigDef::Flexbody &def)
void ProcessRopable(RigDef::Ropable &def)
void ProcessShock(RigDef::Shock &def)
unsigned int AddWheelBeam(node_t *node_1, node_t *node_2, float spring, float damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, float max_contraction=-1.f, float max_extension=-1.f, BeamType type=BEAM_NORMAL)
'wheels', 'meshwheels', 'meshwheels2'
void CreateFlexBodyWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, NodeNum_t axis_node_1, NodeNum_t axis_node_2, int num_rays, float radius, WheelSide side, std::string rim_mesh_name, std::string rim_mesh_rg, std::string tire_mesh_name, std::string tire_mesh_rg)
void ProcessTurboprop2(RigDef::Turboprop2 &def)
void SetupNewEntity(Ogre::Entity *e, Ogre::ColourValue simple_color)
Full texture and material setup.
void ProcessAuthor(RigDef::Author &def)
Ogre::MaterialPtr FindOrCreateCustomizedMaterial(const std::string &mat_lookup_name, const std::string &mat_lookup_rg)
void ProcessAxle(RigDef::Axle &def)
void ProcessWheel(RigDef::Wheel &def)
void AdjustNodeBuoyancy(node_t &node, RigDef::Node &node_def, std::shared_ptr< RigDef::NodeDefaults > defaults)
For user-defined nodes.
Ogre::MaterialPtr m_simple_material_base
void ProcessGuiSettings(RigDef::GuiSettings &def)
std::string GetSubmeshGroundmodelName()
void ProcessTransferCase(RigDef::TransferCase &def)
Ogre::SceneNode * m_flares_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
beam_t & GetBeam(unsigned int index)
beam_t * FindBeamInRig(NodeNum_t node_a, NodeNum_t node_b)
void SetBeamStrength(beam_t &beam, float strength)
std::map< Ogre::String, unsigned int > m_named_nodes
void CreateWheelVisuals(WheelID_t wheel_id, NodeNum_t node_base_index, unsigned int def_num_rays, Ogre::String const &face_material_name, Ogre::String const &face_material_rg, Ogre::String const &band_material_name, Ogre::String const &band_material_rg, bool separate_rim, float rim_ratio=1.f)
Ogre::MaterialPtr m_cab_trans_material
void AssignManagedMaterialTexture(Ogre::TextureUnitState *tus, const std::string &mm_name, int media_id, const std::string &tex_name)
Helper for ProcessManagedMaterial()
bool CheckCameraRailLimit(unsigned int count)
void ProcessWheel2(RigDef::Wheel2 &def)
bool CollectNodesFromRanges(std::vector< RigDef::Node::Range > &node_ranges, std::vector< NodeNum_t > &out_node_indices)
Parses list of node-ranges into list of individual nodes.
void ProcessScript(RigDef::Script &def)
unsigned int AddWheelRimBeam(RigDef::Wheel2 &wheel_2_def, node_t *node_1, node_t *node_2)
bool CheckScrewpropLimit(unsigned int count)
void CreateMirrorPropVideoCam(Ogre::MaterialPtr custom_mat, CustomMaterial::MirrorPropType type, Ogre::SceneNode *prop_scenenode)
void ProcessRailGroup(RigDef::RailGroup &def)
float ComputeWingArea(Ogre::Vector3 const &ref, Ogre::Vector3 const &x, Ogre::Vector3 const &y, Ogre::Vector3 const &aref)
Ogre::SceneNode * m_particles_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
void ProcessContacter(RigDef::Node::Ref &node_ref)
void ProcessSpeedLimiter(RigDef::SpeedLimiter &def)
void ProcessEngine(RigDef::Engine &def)
void ProcessWing(RigDef::Wing &def)
bool CheckAxleLimit(unsigned int count)
std::shared_ptr< RigDef::Document::Module > m_current_module
For resolving addonparts.
RailGroup * CreateRail(std::vector< RigDef::Node::Range > &node_ranges)
void ProcessSubmesh(RigDef::Submesh &def)
void ProcessAnimator(RigDef::Animator &def)
void ProcessNode(RigDef::Node &def)
RigDef::DocumentPtr m_file
void ProcessCinecam(RigDef::Cinecam &def)
void ProcessFlaregroupNoImport(RigDef::FlaregroupNoImport &def)
void ProcessManagedMaterial(RigDef::ManagedMaterial &def)
void ProcessShock3(RigDef::Shock3 &def)
void CreateBeamVisuals(beam_t &beam, int beam_index, bool visible, std::shared_ptr< RigDef::BeamDefaults > const &beam_defaults, std::string material_override="")
beam_t & GetAndInitFreeBeam(node_t &node_1, node_t &node_2)
void _ProcessSimpleInertia(RigDef::Inertia &def, RoR::SimpleInertia &obj)
void ProcessFusedrag(RigDef::Fusedrag &def)
void CreateMaterialFlare(int flare_index, Ogre::MaterialPtr mat)
void ProcessCommand(RigDef::Command2 &def)
std::string m_custom_resource_group
Ogre::SceneNode * m_wheels_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
Ogre::SceneNode * m_props_parent_scenenode
this isn't used for moving/hiding things, just helps developers inspect the scene graph.
ActorMemoryRequirements m_memory_requirements
void ProcessCamera(RigDef::Camera &def)
bool CheckSubmeshLimit(unsigned int count)
beam_t & AddBeam(node_t &node_1, node_t &node_2, std::shared_ptr< RigDef::BeamDefaults > &defaults, int detacher_group)
void ProcessTie(RigDef::Tie &def)
void ProcessFlexBodyWheel(RigDef::FlexBodyWheel &def)
void ProcessPistonprop(RigDef::Pistonprop &def)
void ProcessInterAxle(RigDef::InterAxle &def)
void ProcessBrakes(RigDef::Brakes &def)
void CalcMemoryRequirements(ActorMemoryRequirements &req, RigDef::Document::Module *module_def)
void BuildWheelBeams(unsigned int num_rays, NodeNum_t base_node_index, node_t *axis_node_1, node_t *axis_node_2, float tyre_spring, float tyre_damping, float rim_spring, float rim_damping, std::shared_ptr< RigDef::BeamDefaults > beam_defaults, RigDef::Node::Ref const &rigidity_node_id, float max_extension=0.f)
'wheels', 'meshwheels'
void CreateVideoCamera(RigDef::VideoCamera *def)
void ProcessMeshWheel(RigDef::MeshWheel &def)
void ProcessCustomDashInputs(RigDef::CustomDashboardInput &def)
void ProcessLockgroup(RigDef::Lockgroup &lockgroup)
RoR::FlexFactory m_flex_factory
void ProcessHelp(RigDef::Help &def)
std::string ComposeName(const std::string &object, int number=-1)
Creates name containing actor ID token, i.e. "Object#1 (filename.truck [Instance ID 1])".
void ProcessAirbrake(RigDef::Airbrake &def)
void ProcessRotator(RigDef::Rotator &def)
std::vector< CabTexcoord > m_oldstyle_cab_texcoords
static void SetupDefaultSoundSources(ActorPtr const &actor)
Ogre::MaterialPtr CreateSimpleMaterial(Ogre::ColourValue color)
bool CheckCabLimit(unsigned int count)
void AddBaseFlare(RigDef::FlareBase &flare_def)
void ProcessShock2(RigDef::Shock2 &def)
Ogre::Vector3 m_spawn_position
void CreateDashboardRttLayers()
RigDef::VideoCamera * FindVideoCameraByMaterial(std::string const &material_name)
Returns NULL if none found.
std::string m_cab_material_name
Original name defined in truckfile/globals.
Ogre::MaterialPtr InstantiateManagedMaterial(Ogre::String const &rg_name, Ogre::String const &source_name, Ogre::String const &clone_name)
bool m_apply_simple_materials
void ProcessTrigger(RigDef::Trigger &def)
void ProcessCameraRail(RigDef::CameraRail &def)
Ogre::SceneNode * m_curr_mirror_prop_scenenode
std::vector< RTTLayer * > m_texturedashboard_rtt_layers
layouts specified in 'guisettings/texturedashboard'.
void ProcessCollisionBox(RigDef::CollisionBox &def)
NodeNum_t ResolveNodeRef(RigDef::Node::Ref const &node_ref, bool optional=false)
void ProcessTorqueCurve(RigDef::TorqueCurve &def)
RigDef::Keyword m_current_keyword
For error reports.
std::string GetCurrentElementMediaRG()
Where to load media from (the addonpart's bundle or vehicle's bundle?)
void ProcessDescription(Ogre::String const &line)
void AddMessage(Message type, Ogre::String const &text)
Maintenance.
void AddExhaust(NodeNum_t emitter_node_idx, NodeNum_t direction_node_idx)
void BuildWheelObjectAndNodes(WheelID_t wheel_id, unsigned int num_rays, node_t *axis_node_1, node_t *axis_node_2, node_t *reference_arm_node, unsigned int reserve_nodes, unsigned int reserve_beams, float wheel_radius, WheelPropulsion propulsion, WheelBraking braking, std::shared_ptr< RigDef::NodeDefaults > node_defaults, float wheel_mass, float wheel_width=-1.f)
Sets up wheel and builds nodes for sections 'wheels', 'meshwheels' and 'meshwheels2'.
void ProcessCollisionRange(RigDef::CollisionRange &def)
Ogre::SceneNode * m_actor_grouping_scenenode
Topmost common parent; this isn't used for moving things, just helps developers inspect the scene gra...
int m_airplane_right_light
bool CheckAeroEngineLimit(unsigned int count)
void ProcessEngoption(RigDef::Engoption &def)
NOTE: Modcache processes this format directly using RoR::GenericDocument, see RoR::CacheSystem::FillA...
void ResolveUnwantedAndTweakedElements(TuneupDefPtr &tuneup, CacheEntryPtr &addonpart_entry)
Evaluates 'addonpart_unwanted_*' elements, respecting 'protected_*' directives in the tuneup.
static void ResetUnwantedAndTweakedElements(TuneupDefPtr &tuneup)
virtual float getRadius()=0
virtual int getNoderef()=0
virtual AeroEngineType getType()=0
Ogre::Vector3 offset
gfx attribute
Represents an airfoil http://en.wikipedia.org/wiki/Airfoil.
Ogre::RenderWindow * CreateCustomRenderWindow(std::string const &name, int width, int height)
void setInertialReferences(node_t *refl, node_t *refr, node_t *refb, node_t *refc)
Ogre::String fname
filename
Ogre::String dname
name parsed from the file
SkinDocumentPtr skin_def
Cached skin info, added on first use or during cache rebuild.
Ogre::String resource_group
Resource group of the loaded bundle. Empty if not loaded yet.
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,...
void LoadResource(CacheEntryPtr &t)
Loads the associated resource bundle if not already done.
Ogre::Camera * GetCamera()
Designed to be run in physics loop (2khz)
int SetCmdKeyDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
ground_model_t * defaultgm
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
int getLinkIDForName(Ogre::String &str)
int registerCustomInput(Ogre::String name, int dataType)
DashBoard * loadDashBoard(const std::string &filename, BitMask_t flags, RTTLayer *rttLayer)
int di_idx_1
array location of wheel / axle 1
int di_idx_2
array location of wheel / axle 2
void AddDifferentialType(DiffType diff)
A land vehicle engine + transmission.
char getEngineType() const
't' = truck (default), 'c' = car, 'e' = electric car ('engoption' attr #2)
char m_engine_type
't' = truck (default), 'c' = car ('engoption' attr #2)
NodeNum_t m_air_intake_node
Node number of the air intake node (if any) - defaults to cinecam ref node (classic behavior) but can...
bool m_engine_has_air
Engine attribute.
void SetEngineOptions(float einertia, char etype, float eclutch, float ctime, float stime, float pstime, float irpm, float srpm, float maximix, float minimix, float ebraking)
TorqueCurve * getTorqueCurve()
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 setAutoMode(SimGearboxMode mode)
float m_turbo_inertia_factor
void enableInducedDrag(float span, float area, bool l)
void addwash(int propid, float ratio)
Flexbody = A deformable mesh; updated on CPU every frame, then uploaded to video memory.
CameraMode_t fb_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
@ TUNING_REMOVED_PLACEHOLDER
@ FAULTY_MESH_PLACEHOLDER
@ FAULTY_FORSET_PLACEHOLDER
CameraMode_t fb_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
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)
void SaveFlexbodiesToCache()
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)
void CheckAndLoadFlexbodyCache()
Consists of static mesh, representing the rim, and dynamic mesh, representing the tire.
Ogre::Entity * GetTireEntity()
A visual mesh, forming a chassis for softbody actor At most one instance is created per actor.
RTTLayerManager & GetRttLayerManager()
const TerrainPtr & GetTerrain()
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
ActorManager * GetActorManager()
void RegisterCabMesh(Ogre::Entity *ent, Ogre::SceneNode *snode, FlexObj *flexobj)
void UpdateSimDataBuffer()
Copies sim. data from Actor to GfxActor for later update.
Ogre::SceneManager * GetSceneManager()
RTT texture 'slot' within MyGUI system; we can only create them, not destroy, so we reuse.
void setTextureSize(const MyGUI::IntSize &_size)
Call before createRttTexture()
const std::string & getTextureName() const
void setTextureName(const std::string &_name)
Call before createRttTexture()
RTTLayer * CreateOrReuseRttLayer()
Designed to be run on main/rendering loop (FPS)
void SetSimpleDelay(RoR::CmdKeyInertiaConfig &cfg, float start_delay, float stop_delay, std::string start_function, std::string stop_function)
void SetAttachmentRate(float rate)
How long it will take for springs to fully attach to the Rail.
void SetBreakForce(float breakRate)
Force required to break the Node from the Rail.
void SetCorThreshold(float threshold)
Distance from a beam before corrective forces take effect.
void SetDefaultRail(RailGroup *rail)
Sets rail to initially use when spawned or reset.
void SetSpringRate(float rate)
Spring force used to calculate corrective forces.
bool sn_attach_self
Attach/detach to rails on the current vehicle only.
void SetAttachmentDistance(float dist)
Maximum distance this spring node is allowed to reach out for a Rail.
bool sn_attach_foreign
Attach/detach to rails only on other vehicles.
Wrapper for classic c-string (local buffer) Refresher: strlen() excludes '\0' terminator; strncat() A...
const char * ToCStr() const
Collisions * GetCollisions()
This class loads and processes a torque curve for a vehicle.
Ogre::SimpleSpline * getUsedSpline()
Returns the used spline.
void AddCurveSample(float rpm, float progress, Ogre::String const &model=customModel)
Adds a point to the torque curve graph.
int spaceCurveEvenly(Ogre::SimpleSpline *spline)
Spaces the points of a spline evenly; this is needed for the correct calculation of the Ogre simple s...
int setTorqueModel(Ogre::String name)
Sets the torque model which is used for the vehicle.
bool CreateNewCurve(Ogre::String const &name=customModel)
Creates new torque curve.
bool tr_4wd_mode
Enables 4WD mode.
int tr_ax_2
This axle is only driven in 4WD mode.
int tr_ax_1
This axle is always driven.
static Ogre::Vector3 getTweakedPropRotation(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
static VideoCamRole getTweakedVideoCameraRole(TuneupDefPtr &tuneup_def, VideoCameraID_t camera_id, VideoCamRole orig_val)
static std::string getTweakedPropMedia(TuneupDefPtr &tuneup_entry, PropID_t prop_id, int media_idx, const std::string &orig_val)
static std::string getTweakedPropMediaRG(TuneupDefPtr &tuneup_def, PropID_t prop_id, int media_idx, const std::string &orig_val)
static bool isPropAnyhowRemoved(TuneupDefPtr &tuneup_def, PropID_t prop_id)
static Ogre::Vector3 getTweakedCineCameraPosition(TuneupDefPtr &tuneup_entry, CineCameraID_t cinecamid, Ogre::Vector3 orig_val)
static Ogre::Vector3 getTweakedPropOffset(TuneupDefPtr &tuneup_entry, PropID_t prop_id, Ogre::Vector3 orig_val)
static bool isFlareAnyhowRemoved(TuneupDefPtr &tuneup_def, FlareID_t flare_id)
static std::string getTweakedFlexbodyMediaRG(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
static float getTweakedWheelTireRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
static std::string getTweakedFlexbodyMedia(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, int media_idx, const std::string &orig_val)
static bool isManagedMatAnyhowRemoved(TuneupDefPtr &tuneup_def, const std::string &matname)
static Ogre::Vector3 getTweakedFlexbodyOffset(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
static float getTweakedWheelRimRadius(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, float orig_val)
static std::string getTweakedManagedMatMediaRG(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
static std::string getTweakedManagedMatMedia(TuneupDefPtr &tuneup_def, const std::string &matname, int media_idx, const std::string &orig_val)
static Ogre::Vector3 getTweakedNodePosition(TuneupDefPtr &tuneup_entry, NodeNum_t nodenum, Ogre::Vector3 orig_val)
static Ogre::Vector3 getTweakedFlexbodyRotation(TuneupDefPtr &tuneup_entry, FlexbodyID_t flexbody_id, Ogre::Vector3 orig_val)
static bool isFlexbodyAnyhowRemoved(TuneupDefPtr &tuneup_def, FlexbodyID_t flexbody_id)
static WheelSide getTweakedWheelSide(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, WheelSide orig_val)
static bool isExhaustAnyhowRemoved(TuneupDefPtr &tuneup_def, ExhaustID_t exhaust_id)
static std::string getTweakedWheelMediaRG(TuneupDefPtr &tuneup_def, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
static std::string getTweakedWheelMedia(TuneupDefPtr &tuneup_entry, WheelID_t wheel_id, int media_idx, const std::string &orig_val)
TurbojetVisual tjet_visual
void SetupVisuals(RigDef::Turbojet &def, int num, std::string const &propname, Ogre::Entity *nozzle, Ogre::Entity *afterburner_flame)
void SetNodes(NodeNum_t front, NodeNum_t back, NodeNum_t ref)
void SetVisible(bool visible)
void AddBeam(int beam_id)
const char * KeywordToString(RigDef::Keyword keyword)
@ HYDRO_FLAG_REV_ELEVATOR
@ UNLOCKED
lock not locked
@ TRUCK
its a truck (or other land vehicle)
@ AIRPLANE
its an airplane
const PropAnimFlag_t PROP_ANIM_FLAG_ROLL
const PropAnimFlag_t PROP_ANIM_FLAG_AESTATUS
const PropAnimFlag_t PROP_ANIM_FLAG_ARUDDER
const PropAnimFlag_t PROP_ANIM_FLAG_TACHO
const PropAnimFlag_t PROP_ANIM_FLAG_ALTIMETER
const PropAnimFlag_t PROP_ANIM_FLAG_CLUTCH
const PropAnimFlag_t PROP_ANIM_FLAG_PITCH
const PropAnimMode_t PROP_ANIM_MODE_BOUNCE
const PropAnimFlag_t PROP_ANIM_FLAG_TORQUE
const PropAnimFlag_t PROP_ANIM_FLAG_ELEVATORS
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_X
const PropAnimFlag_t PROP_ANIM_FLAG_AIRBRAKE
const PropAnimMode_t PROP_ANIM_MODE_NOFLIP
const PropAnimFlag_t PROP_ANIM_FLAG_SIGNALSTALK
Turn indicator stalk position (-1=left, 0=off, 1=right)
const PropAnimFlag_t PROP_ANIM_FLAG_FLAP
const PropAnimFlag_t PROP_ANIM_FLAG_AILERONS
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Z
const PropAnimFlag_t PROP_ANIM_FLAG_DASHBOARD
Used with dashboard system inputs, see enum DashData in file DashBoardManager.h.
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Y
const PropAnimFlag_t PROP_ANIM_FLAG_BRUDDER
const PropAnimMode_t PROP_ANIM_MODE_AUTOANIMATE
const PropAnimFlag_t PROP_ANIM_FLAG_AIRSPEED
const PropAnimFlag_t PROP_ANIM_FLAG_TURBO
const PropAnimMode_t PROP_ANIM_MODE_ROTA_Y
const PropAnimFlag_t PROP_ANIM_FLAG_AOA
const PropAnimFlag_t PROP_ANIM_FLAG_VVI
const PropAnimFlag_t PROP_ANIM_FLAG_BTHROTTLE
const PropAnimFlag_t PROP_ANIM_FLAG_THROTTLE
const PropAnimFlag_t PROP_ANIM_FLAG_PBRAKE
const PropAnimFlag_t PROP_ANIM_FLAG_IGNITION
const PropAnimFlag_t PROP_ANIM_FLAG_PERMANENT
const PropAnimFlag_t PROP_ANIM_FLAG_RPM
const PropAnimFlag_t PROP_ANIM_FLAG_HEADING
const PropAnimFlag_t PROP_ANIM_FLAG_AETORQUE
const PropAnimFlag_t PROP_ANIM_FLAG_EVENT
const PropAnimFlag_t PROP_ANIM_FLAG_GEAR
'gearreverse' (animOpt3=-1), 'gearneutral' (animOpt3=0), 'gear#' (animOpt3=#)
const PropAnimFlag_t PROP_ANIM_FLAG_DIFFLOCK
const PropAnimFlag_t PROP_ANIM_FLAG_ACCEL
const PropAnimFlag_t PROP_ANIM_FLAG_STEERING
const PropAnimMode_t PROP_ANIM_MODE_OFFSET_Z
const PropAnimFlag_t PROP_ANIM_FLAG_BRAKE
const PropAnimFlag_t PROP_ANIM_FLAG_SHIFTER
'shifterman1, shifterman2, sequential, shifterlin, autoshifterlin'; animOpt3: see RoR::ShifterPropAni...
const PropAnimFlag_t PROP_ANIM_FLAG_AEPITCH
const PropAnimMode_t PROP_ANIM_MODE_ROTA_X
const PropAnimFlag_t PROP_ANIM_FLAG_SPEEDO
@ MSG_APP_LOAD_SCRIPT_REQUESTED
Payload = RoR::LoadScriptRequest* (owner)
static const int DEFAULT_DETACHER_GROUP
static const float WHEEL_FRICTION_COEF
static const float BEAM_CREAK_DEFAULT
static const float DEFAULT_COLLISION_RANGE
static const float BEAM_DEFORM
static const float DEFAULT_SPEEDO_MAX_KPH
static const float ROTATOR_FORCE_DEFAULT
static const float HOOK_LOCK_TIMER_DEFAULT
static const float BEAM_PLASTIC_COEF_DEFAULT
static const float ROTATOR_TOLERANCE_DEFAULT
static const float NODE_LOADWEIGHT_DEFAULT
static const float HOOK_RANGE_DEFAULT
static const float HOOK_FORCE_DEFAULT
static const float HOOK_SPEED_DEFAULT
static const float NODE_FRICTION_COEF_DEFAULT
@ BEAM_VIRTUAL
Excluded from mass calculations, visuals permanently disabled.
@ SHOCK1
either 'shock1' (with flag BEAM_HYDRO) or a wheel beam
@ LOCAL_SLEEPING
sleeping (local) actor
@ NETWORKED_OK
not simulated (remote) actor
@ SHOCK_FLAG_TRG_CMD_BLOCKER
@ SHOCK_FLAG_TRG_HOOK_UNLOCK
@ SHOCK_FLAG_TRG_HOOK_LOCK
@ SHOCK_FLAG_TRG_BLOCKER_A
@ SHOCK_FLAG_TRG_CONTINUOUS
@ SHOCK_FLAG_TRG_CMD_SWITCH
@ ACTOR
Defined in truck file under 'scripts', contains global variable BeamClass@ thisActor.
@ l_SKIP_LOADED
Only apply minimum mass to nodes without "L" option.
std::shared_ptr< Document > DocumentPtr
AppContext * GetAppContext()
InputEngine * GetInputEngine()
CVar * diag_log_beam_trigger
CameraManager * GetCameraManager()
SoundScriptManager * GetSoundScriptManager()
CVar * gfx_particles_mode
GUIManager * GetGuiManager()
GameContext * GetGameContext()
CVar * diag_log_beam_deform
CVar * gfx_window_videocams
CVar * sim_no_self_collisions
CVar * ui_legacy_truck_renderdash
string; name of the '.dashboard' file in modcache.
CVar * ui_default_boat_dash
string; name of the '.dashboard' file in modcache.
CVar * ui_default_truck_dash
string; name of the '.dashboard' file in modcache.
CVar * diag_simple_materials
CVar * gfx_alt_actor_materials
CacheSystem * GetCacheSystem()
CVar * gfx_reduce_shadows
CVar * diag_log_beam_break
CVar * gfx_enable_videocams
static const NodeNum_t NODENUM_INVALID
@ CURR_VEHICLE_HEAD_ONLY
Only current vehicle, main lights.
@ ALL_VEHICLES_ALL_LIGHTS
All vehicles, all lights.
@ DD_PARKINGBRAKE
chassis pitch
@ LOADDASHBOARD_RTT_TEXTURE
Will be drawn to texture. Unless STACKABLE, it prevents the default dashboard from loading.
@ LOADDASHBOARD_RENDERDASH
Will be drawn to texture in classic 'renderdash' format. Ignores STACKABLE flag.
@ LOADDASHBOARD_SCREEN_HUD
Will be drawn to screen. Unless STACKABLE, it prevents the default dashboard from loading.
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
@ VCAM_ROLE_MIRROR
Flips the video output and when not in driver cam, acts like a natural mirror, not a screen.
@ VCAM_ROLE_TRACKING_MIRROR_NOFLIP
A MIRROR_NOFLIP(2) with tracking node set.
@ VCAM_ROLE_TRACKING_MIRROR
A MIRROR(1) with tracking node set.
@ VCAM_ROLE_MIRROR_PROP_LEFT
The classic 'special prop/rear view mirror'.
@ VCAM_ROLE_TRACKING_VIDEOCAM
@ VCAM_ROLE_MIRROR_PROP_RIGHT
The classic 'special prop/rear view mirror'.
@ VCAM_ROLE_MIRROR_NOFLIP
Same as VCAM_ROLE_MIRROR, but without flipping the texture horizontally (expects texcoords to be alre...
int WheelID_t
Index to Actor::ar_wheels, use RoR::WHEELID_INVALID as empty value.
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
int VideoCameraID_t
Index into GfxActor::m_videocameras, use RoR::VIDEOCAMERAID_INVALID as empty value.
int PropID_t
Index to GfxActor::m_props, use RoR::PROPID_INVALID as empty value.
int FlareID_t
Index into Actor::ar_flares, use RoR::FLAREID_INVALID as empty value.
int ExhaustID_t
Index into GfxActor::m_exhausts, use RoR::EXHAUSTID_INVALID as empty value.
int FlexbodyID_t
Index to GfxActor::m_flexbodies, use RoR::FLEXBODYID_INVALID as empty value.
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
std::shared_ptr< SkinDocument > SkinDocumentPtr
static CameraMode_t CAMERA_MODE_ALWAYS_HIDDEN
int CParticleID_t
Index into GfxActor::m_cparticles, use RoR::CPARTICLEID_INVALID as empty value.
@ LIGHTMASK_REVERSE
reverse light on
@ LIGHTMASK_CUSTOM8
custom light 8 on
@ LIGHTMASK_CUSTOM7
custom light 7 on
@ LIGHTMASK_CUSTOM3
custom light 3 on
@ LIGHTMASK_CUSTOM4
custom light 4 on
@ LIGHTMASK_CUSTOM1
custom light 1 on
@ LIGHTMASK_BRAKES
brake lights on
@ LIGHTMASK_CUSTOM2
custom light 2 on
@ LIGHTMASK_CUSTOM6
custom light 6 on
@ LIGHTMASK_BLINK_RIGHT
right blinker on
@ LIGHTMASK_CUSTOM10
custom light 10 on
@ LIGHTMASK_CUSTOM5
custom light 5 on
@ LIGHTMASK_CUSTOM9
custom light 9 on
@ LIGHTMASK_BLINK_LEFT
left blinker on
static const BitMask_t OPTION_THROTTLE
static const BitMask_t OPTION_RPM
static const BitMask_t OPTION_TORQUE
static const BitMask_t OPTION_PITCH
static const BitMask_t OPTION_STATUS
float max_inclination_angle
static const BitMask_t SOURCE_AERO_PITCH
static const BitMask_t SOURCE_AERO_STATUS
static const BitMask_t SOURCE_AERO_RPM
static const BitMask_t SOURCE_AERO_TORQUE
static const BitMask_t SOURCE_AERO_THROTTLE
static const BitMask_t SOURCE_GEAR_FORWARD
static const BitMask64_t SOURCE_GEAR_REVERSE
static const BitMask64_t SOURCE_TURBO
static const BitMask64_t SOURCE_SEQUENTIAL_SHIFT
static const BitMask64_t SOURCE_AIR_RUDDER
static const BitMask_t MODE_ROTATION_X
static const BitMask64_t SOURCE_ALTIMETER_1K
static const BitMask64_t SOURCE_AUTOSHIFTERLIN
static const BitMask_t MODE_OFFSET_Y
static const BitMask64_t SOURCE_SHIFT_LEFT_RIGHT
static const BitMask_t MODE_NO_FLIP
static const BitMask64_t SOURCE_FLAP
static const BitMask64_t SOURCE_SPEEDO
static const BitMask64_t SOURCE_DIFFLOCK
static const BitMask64_t SOURCE_ALTIMETER_10K
static const BitMask64_t SOURCE_AIRSPEED
static const BitMask_t MODE_AUTO_ANIMATE
static const BitMask64_t SOURCE_ROLL
static const BitMask64_t SOURCE_BOAT_THROTTLE
static const BitMask64_t SOURCE_CLUTCH
static const BitMask_t MODE_OFFSET_Z
static const BitMask64_t SOURCE_PITCH
static const BitMask64_t SOURCE_TACHO
static const BitMask64_t SOURCE_AILERON
static const BitMask_t MODE_ROTATION_Y
static const BitMask64_t SOURCE_ELEVATOR
static const BitMask64_t SOURCE_PERMANENT
static const BitMask_t MODE_EVENT_LOCK
static const BitMask64_t SOURCE_STEERING_WHEEL
static const BitMask64_t SOURCE_PARKING
static const BitMask64_t SOURCE_SHIFT_BACK_FORTH
static const BitMask64_t SOURCE_ACCEL
static const BitMask64_t SOURCE_IGNITION
static const BitMask64_t SOURCE_AIR_BRAKE
static const BitMask64_t SOURCE_GEAR_NEUTRAL
static const BitMask64_t SOURCE_ANGLE_OF_ATTACK
static const BitMask64_t SOURCE_VERTICAL_VELOCITY
static const BitMask_t MODE_OFFSET_X
static const BitMask_t MODE_BOUNCE
static const BitMask64_t SOURCE_SHIFTERLIN
static const BitMask64_t SOURCE_ALTIMETER_100K
static const BitMask64_t SOURCE_BOAT_RUDDER
static const BitMask64_t SOURCE_BRAKES
static const BitMask64_t SOURCE_TORQUE
static const BitMask_t MODE_ROTATION_Z
static const BitMask64_t SOURCE_DASHBOARD
static const BitMask64_t SOURCE_EVENT
static const BitMask64_t SOURCE_HEADING
static const BitMask64_t SOURCE_SIGNALSTALK
static const BitMask_t OPTION_ALTIMETER_100K
static const BitMask_t OPTION_ALTIMETER_1K
static const BitMask_t OPTION_SPEEDO
static const BitMask_t OPTION_ACCEL
static const BitMask_t OPTION_AIR_BRAKE
static const BitMask_t OPTION_ANGLE_OF_ATTACK
static const BitMask_t OPTION_BOAT_RUDDER
static const BitMask_t OPTION_ROLL
static const BitMask_t OPTION_SEQUENTIAL_SHIFT
static const BitMask_t OPTION_PARKING
static const BitMask_t OPTION_TURBO
static const BitMask_t OPTION_SHIFT_BACK_FORTH
static const BitMask_t OPTION_PITCH
AeroAnimator aero_animator
static const BitMask_t OPTION_AIRSPEED
std::shared_ptr< Inertia > inertia_defaults
static const BitMask_t OPTION_BOAT_THROTTLE
static const BitMask_t OPTION_SHORT_LIMIT
static const BitMask_t OPTION_ALTIMETER_10K
static const BitMask_t OPTION_VERTICAL_VELOCITY
static const BitMask_t OPTION_FLAP
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t OPTION_BRAKES
static const BitMask_t OPTION_TORQUE
static const BitMask_t OPTION_SHIFT_LEFT_RIGHT
static const BitMask_t OPTION_LONG_LIMIT
static const BitMask_t OPTION_INVISIBLE
static const BitMask_t OPTION_CLUTCH
static const BitMask_t OPTION_GEAR_SELECT
static const BitMask_t OPTION_TACHO
unsigned int forum_account_id
DifferentialTypeVec options
Order matters!
Ogre::String material_name
RoR::WheelBraking braking
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< NodeDefaults > node_defaults
RoR::WheelPropulsion propulsion
Node::Ref reference_arm_node
static const BitMask_t OPTION_r_ROPE
std::shared_ptr< BeamDefaults > defaults
float extension_break_limit
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_s_SUPPORT
float default_braking_force
float parking_brake_force
static const BitMask_t OPTION_r_BUOYANT_ONLY_DRAG
static const BitMask_t OPTION_p_10xTOUGHER
static const BitMask_t OPTION_s_BUOYANT_NO_DRAG
static const BitMask_t OPTION_F_10xTOUGHER_BUOYANT
static const BitMask_t OPTION_b_BUOYANT
static const BitMask_t OPTION_D_CONTACT_BUOYANT
static const BitMask_t OPTION_S_INVULNERABLE_BUOYANT
static const BitMask_t OPTION_c_CONTACT
static const BitMask_t OPTION_u_INVULNERABLE
std::vector< Node::Ref > nodes
int mode
0 and higher = cinecam index
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< NodeDefaults > node_defaults
std::vector< Node::Ref > nodes
float node_collision_range
std::shared_ptr< Inertia > inertia_defaults
RoR::CommandkeyID_t extend_key
RoR::CommandkeyID_t contract_key
std::shared_ptr< BeamDefaults > beam_defaults
bool option_o_1press_center
bool option_c_auto_center
std::vector< Node::Ref > fixes
std::vector< Wheel2 > wheels2
std::vector< Rotator2 > rotators2
std::vector< Rotator > rotators
std::vector< Wing > wings
std::vector< MeshWheel2 > meshwheels2
std::vector< Shock > shocks
std::vector< Shock2 > shocks2
std::vector< MeshWheel > meshwheels
std::vector< Animator > animators
std::vector< Cinecam > cinecam
std::vector< FlexBodyWheel > flexbodywheels
std::vector< Node > nodes
std::vector< Rope > ropes
std::vector< Wheel > wheels
std::vector< Command2 > commands2
std::vector< Trigger > triggers
std::vector< Shock3 > shocks3
std::vector< Hydro > hydros
std::vector< Beam > beams
std::vector< Airbrake > airbrakes
std::vector< float > gear_ratios
float post_shift_time
Seconds.
float clutch_time
Seconds.
Ogre::String particle_name
std::shared_ptr< Inertia > inertia_defaults
Ogre::String material_name
int control_number
Only 'u' type flares.
std::string dashboard_link
Only 'd' type flares.
int control_number
Only 'u' type flares.
Ogre::String tyre_mesh_name
Ogre::String rim_mesh_name
CameraSettings camera_settings
std::vector< Node::Ref > node_list
std::vector< Forvert > forvert
Ogre::String airfoil_name
Ogre::String material_name
float option_min_range_meters
static const BitMask_t OPTION_e_INPUT_ELEVATOR
std::shared_ptr< Inertia > inertia_defaults
static const BitMask_t OPTION_s_DISABLE_ON_HIGH_SPEED
static const BitMask_t OPTION_h_INPUT_InvELEVATOR_RUDDER
static const BitMask_t OPTION_g_INPUT_ELEVATOR_RUDDER
static const BitMask_t OPTION_y_INPUT_InvAILERON_RUDDER
static const BitMask_t OPTION_j_INVISIBLE
static const BitMask_t OPTION_v_INPUT_InvAILERON_ELEVATOR
static const BitMask_t OPTION_a_INPUT_AILERON
static const BitMask_t OPTION_r_INPUT_RUDDER
static const BitMask_t OPTION_n_INPUT_NORMAL
static const BitMask_t OPTION_u_INPUT_AILERON_ELEVATOR
static const BitMask_t OPTION_x_INPUT_AILERON_RUDDER
std::shared_ptr< BeamDefaults > beam_defaults
Ogre::String start_function
Ogre::String stop_function
DifferentialTypeVec options
Order matters!
static const int LOCKGROUP_NOLOCK
std::vector< Node::Ref > nodes
static const int LOCKGROUP_DEFAULT
ManagedMaterialsOptions options
Ogre::String specular_map
Ogre::String damaged_diffuse_map
float global_min_mass_Kg
minimum node mass in Kg - only effective where DefaultMinimass was not set.
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t OPTION_c_NO_GROUND_CONTACT
static const BitMask_t OPTION_p_NO_PARTICLES
std::shared_ptr< DefaultMinimass > default_minimass
bool _has_load_weight_override
static const BitMask_t OPTION_f_NO_SPARKS
static const BitMask_t OPTION_b_EXTRA_BUOYANCY
static const BitMask_t OPTION_x_EXHAUST_POINT
std::shared_ptr< NodeDefaults > node_defaults
float load_weight_override
static const BitMask_t OPTION_h_HOOK_POINT
static const BitMask_t OPTION_m_NO_MOUSE_GRAB
static const BitMask_t OPTION_l_LOAD_WEIGHT
static const BitMask_t OPTION_y_EXHAUST_DIRECTION
Ogre::String particle_system_name
Node::Ref blade_tip_nodes[4]
Ogre::String flare_material_name
DashboardSpecial special_prop_dashboard
CameraSettings camera_settings
BeaconSpecial special_prop_beacon
std::list< Animation > animations
std::vector< Node::Range > node_list
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< Inertia > inertia_defaults
unsigned int spin_left_key
Node::Ref base_plate_nodes[4]
Node::Ref rotating_plate_nodes[4]
unsigned int spin_right_key
static const BitMask_t OPTION_i_INVISIBLE
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float progress_factor_damp_out
Progression factor dampout, 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spring...
float damp_out
damping value applied when shock extending
float progress_factor_damp_in
Progression factor for dampin. 0 = disabled, 1...x as multipliers, example:maximum dampingrate == spr...
std::shared_ptr< BeamDefaults > beam_defaults
static const BitMask_t OPTION_m_METRIC
float spring_in
Spring value applied when the shock is compressing.
static const BitMask_t OPTION_s_SOFT_BUMP_BOUNDS
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
float progress_factor_spring_out
Progression factor springout, 0 = disabled, 1...x as multipliers, example:maximum springrate == sprin...
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
float spring_out
spring value applied when shock extending
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
float damp_in
Damping value applied when the shock is compressing.
float progress_factor_spring_in
Progression factor for springin. A value of 0 disables this option. 1...x as multipliers,...
float damp_in_slow
Damping value applied when shock is commpressing slower than split in velocity.
float spring_in
Spring value applied when the shock is compressing.
float spring_out
Spring value applied when shock extending.
static const BitMask_t OPTION_M_ABSOLUTE_METRIC
float damp_in
Damping value applied when the shock is compressing.
float split_vel_in
Split velocity in (m/s) - threshold for slow / fast damping during compression.
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_m_METRIC
std::shared_ptr< BeamDefaults > beam_defaults
float damp_out
Damping value applied when shock extending.
float long_bound
Maximum extension limit, in percentage ( 1.00 = 100% )
float short_bound
Maximum contraction limit, in percentage ( 1.00 = 100% )
float damp_out_slow
Damping value applied when shock is commpressing slower than split out velocity.
float damp_out_fast
Damping value applied when shock is commpressing faster than split out velocity.
float damp_in_fast
Damping value applied when shock is commpressing faster than split in velocity.
float split_vel_out
Split velocity in (m/s) - threshold for slow / fast damping during extension.
static const BitMask_t OPTION_L_ACTIVE_LEFT
std::shared_ptr< BeamDefaults > beam_defaults
float damping
The 'resistance to motion' of the shock. The best value is given by this equation: 2 * sqrt(suspended...
float spring_rate
The 'stiffness' of the shock. The higher the value, the less the shock will move for a given bump.
static const BitMask_t OPTION_m_METRIC
float precompression
Changes compression or extension of the suspension when the truck spawns. This can be used to "level"...
float short_bound
Maximum contraction. The shortest length the shock can be, as a proportion of its original length....
float long_bound
Maximum extension. The longest length a shock can be, as a proportion of its original length....
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_R_ACTIVE_RIGHT
static const BitMask_t CONSTRAINT_ATTACH_ALL
static const BitMask_t CONSTRAINT_ATTACH_NONE
static const BitMask_t CONSTRAINT_ATTACH_FOREIGN
bool _attachment_rate_set
static const BitMask_t CONSTRAINT_ATTACH_SELF
bool _max_attach_dist_set
BitMask_t constraint_flags
std::vector< Node::Range > rail_node_ranges
int mode
A special constant or cinecam index.
Ogre::String sound_script_name
std::vector< Cab > cab_triangles
std::vector< Texcoord > texcoords
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_s_DISABLE_SELF_LOCK
std::shared_ptr< BeamDefaults > beam_defaults
std::vector< Sample > samples
Ogre::String predefined_func_name
std::vector< float > gear_ratios
static const BitMask_t OPTION_B_TRIGGER_BLOCKER
static const BitMask_t OPTION_s_CMD_NUM_SWITCH
static const BitMask_t OPTION_h_UNLOCKS_HOOK_GROUP
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_t_CONTINUOUS
static const BitMask_t OPTION_E_ENGINE_TRIGGER
static const BitMask_t OPTION_c_COMMAND_STYLE
static const BitMask_t OPTION_b_KEY_BLOCKER
float contraction_trigger_limit
static const BitMask_t OPTION_x_START_DISABLED
std::shared_ptr< BeamDefaults > beam_defaults
int longbound_trigger_action
float expansion_trigger_limit
static const BitMask_t OPTION_H_LOCKS_HOOK_GROUP
static const BitMask_t OPTION_A_INV_TRIGGER_BLOCKER
int shortbound_trigger_action
Node::Ref blade_tip_nodes[4]
RoR::VideoCamRole camera_role
Ogre::String material_name
unsigned int texture_width
Node::Ref alt_orientation_node
Node::Ref alt_reference_node
unsigned int texture_height
Ogre::String face_material_name
Ogre::String band_material_name
Ogre::String band_material_name
Ogre::String face_material_name
WingControlSurface control_surface
float global_minimass
'minimass' - used where 'set_default_minimass' is not applied.
RigDef::VideoCamera * video_camera_def
Ogre::MaterialPtr material
RigDef::MaterialFlareBinding * material_flare_def
MirrorPropType mirror_prop_type
Ogre::SceneNode * mirror_prop_scenenode
Ogre::SceneNode * abx_scenenode
Ogre::Entity * abx_entity
Visuals of softbody beam (beam_t struct); Partially updated along with SimBuffer.
NodeNum_t rod_node2
Node index - may change during simulation!
Ogre::SceneNode * rod_scenenode
ActorPtr rod_target_actor
NodeNum_t rod_node1
Node index - may change during simulation!
Ogre::ParticleSystem * psys
Submesh for old-style actor body (the "cab")
BackmeshType backmesh_type
Texture coordinates for old-style actor body (the "cab")
Ogre::ParticleSystem * smoker
This remains nullptr if removed via addonpart_unwanted_exhaust or Tuning UI.
Ogre::SceneNode * smokeNode
std::string particleSystemName
Name in .particle file ~ for display in Tuning UI.
Ogre::ColourValue emissive_color
Ogre::MaterialPtr mat_instance
< Node resolution must be done in ActorSpawner, but vert resolution in FlexBody
std::string lsr_filename
Load from resource ('.as' file or '.gadget' file); If buffer is supplied, use this as display name on...
ScriptCategory lsr_category
ActorInstanceID_t lsr_associated_actor
For ScriptCategory::ACTOR.
Unified game event system - all requests and state changes are reported using a message.
Gfx attributes/state of a softbody node.
bool nx_no_sparks
User-defined attr;.
bool nx_no_particles
User-defined attr; disable all particles.
bool nx_may_get_wet
Attr; enables water drip and vapour.
float upper_limit
The upper limit for the animation.
float lower_limit
The lower limit for the animation.
float animratio
A coefficient for the animation, prop degree if used with mode: rotation and propoffset if used with ...
float animOpt3
MULTIPURPOSE.
User input state for animated props with 'source:event'.
A mesh attached to vehicle frame via 3 nodes.
float pp_beacon_rot_angle[4]
Radians.
MeshObject * pp_wheel_mesh_obj
Ogre::SceneNode * pp_beacon_scene_node[4]
CameraMode_t pp_camera_mode_active
Dynamic visibility mode {0 and higher = cinecam index}.
CameraMode_t pp_camera_mode_orig
Dynamic visibility mode {0 and higher = cinecam index}.
bool pp_aero_propeller_spin
Special - blurred spinning propeller effect.
Ogre::Vector3 pp_offset_orig
Used with ANIM_FLAG_OFFSET*.
Ogre::SceneNode * pp_scene_node
The pivot scene node (parented to root-node).
std::vector< PropAnim > pp_animations
std::string pp_media[2]
Redundant, for Tuning UI. Media1 = prop mesh name, Media2 = steeringwheel mesh/beaconprop flare mat.
Ogre::BillboardSet * pp_beacon_bbs[4]
char pp_beacon_type
Special prop: beacon {0 = none, 'b' = user-specified, 'r' = red, 'p' = police lightbar,...
bool pp_aero_propeller_blade
Special - single blade mesh.
Ogre::Light * pp_beacon_light[4]
Ogre::Vector3 pp_wheel_pos
Ogre::SceneNode * pp_wheel_scene_node
float pp_wheel_rot_degree
MeshObject * pp_mesh_obj
Optional; NULL if removed via tuneup/addonpart.
float pp_beacon_rot_rate[4]
Radians per second.
A series of RailSegment-s for SlideNode to slide along. Can be closed in a loop.
std::vector< RailSegment > rg_segments
int rg_id
Spawn context - matching separately defined rails with slidenodes.
std::set< std::string > use_addonparts
Addonpart filenames.
UI helper for displaying command control keys to user.
std::string uckp_description
An Ogre::Camera mounted on the actor and rendering into either in-scene texture or external window.
Ogre::TexturePtr vcam_render_tex
NodeNum_t vcam_node_center
NodeNum_t vcam_node_alt_pos
Ogre::RenderWindow * vcam_render_window
std::string vcam_off_tex_name
Used when videocamera is offline.
Ogre::RenderTexture * vcam_render_target
std::string vcam_mat_name_orig
For display in Tuning UI: Original material name from rig-def file, without per-actor stamping.
NodeNum_t vcam_node_lookat
Only for VCAM_ROLE_TRACK_CAM.
Ogre::Quaternion vcam_rotation
NodeNum_t vcam_node_dir_y
Ogre::Vector3 vcam_pos_offset
Ogre::SceneNode * vcam_debug_node
Ogre::SceneNode * vcam_prop_scenenode
Only for VCAM_ROLE_MIRROR_PROP_*.
Ogre::MaterialPtr vcam_material
Ogre::Camera * vcam_ogre_camera
NodeNum_t vcam_node_dir_z
std::string wx_rim_mesh_name
Redundant, for Tuning UI. Only for 'meshwheels[2]' and 'flexbodywheels'.
Ogre::SceneNode * wx_scenenode
Simulation: An edge in the softbody structure.
float refL
reference length
int detacher_group
Attribute: detacher group number (integer)
float default_beam_diameter
for export only
RoR::CmdKeyInertia command_inertia
std::vector< commandbeam_t > beams
float cmb_engine_coupling
Attr from truckfile.
uint16_t cmb_beam_index
Index to Actor::ar_beams array.
bool cmb_is_contraction
Attribute defined at spawn.
float cmb_center_length
Attr computed at spawn.
bool cmb_needs_engine
Attribute defined in truckfile.
bool cmb_is_force_restricted
Attribute defined in truckfile.
float cmb_boundary_length
Attr; Maximum/minimum length proportional to orig. len.
bool cmb_is_1press
Attribute defined in truckfile.
float cmb_speed
Attr; Rate of contraction/extension.
bool cmb_is_autocentering
Attribute defined in truckfile.
bool cmb_is_1press_center
Attribute defined in truckfile.
bool cmb_plays_sound
Attribute defined in truckfile.
std::shared_ptr< commandbeam_state_t > cmb_state
Ogre::BillboardSet * bbs
This remains nullptr if removed via addonpart_unwanted_flare or Tuning UI.
SimpleInertia inertia
Only 'flares3'.
int dashboard_link
Only 'd' type flares, valid values are DD_*.
bool uses_inertia
Only 'flares3'.
int controlnumber
Only 'u' type flares, valid values 0-9, maps to EV_TRUCK_LIGHTTOGGLE01 to 10.
float hk_min_length
Absolute value in meters.
< beams updating length based on simulation variables, generally known as actuators.
BitMask_t hb_flags
Only for 'hydros'.
float hb_speed
Rate of change.
float hb_anim_param
Only for 'animators'.
RoR::CmdKeyInertia hb_inertia
uint16_t hb_beam_index
Index to Actor::ar_beams array.
BitMask_t hb_anim_flags
Only for 'animators'.
float hb_ref_length
Idle length in meters.
Physics: A vertex in the softbody structure.
bool nd_cinecam_node
Attr; User-defined.
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
static const int8_t INVALID_BBOX
bool nd_no_mouse_grab
Attr; User-defined.
bool nd_rim_node
Attr; This node is part of a rim (only wheel types with separate rim nodes)
int16_t nd_lockgroup
Optional attribute (-1 = default, 9999 = deny lock) - used in the hook lock logic.
bool nd_contacter
Attr; User-defined.
Ogre::Vector3 RelPosition
relative to the local physics origin (one origin per actor) (shaky)
bool nd_immovable
Attr; User-defined.
bool nd_cab_node
Attr; This node is part of collision triangle.
bool nd_contactable
Attr; This node will be treated as contacter on inter truck collisions.
int16_t nd_coll_bbox_id
Optional attribute (-1 = none) - multiple collision bounding boxes defined in truckfile.
bool nd_tyre_node
Attr; This node is part of a tyre (note some wheel types don't use rim nodes at all)
bool nd_no_ground_contact
User-defined attr; node ignores contact with ground.
bool nd_loaded_mass
User-defined attr; mass is calculated from 'globals/loaded-mass' rather than 'globals/dry-mass' - set...
bool nd_override_mass
User defined attr; mass is user-specified rather than calculated (override the calculation)
NodeNum_t pos
This node's index in Actor::ar_nodes array.
int pos
Index into ar_ropables.
ropable_t * rp_locked_ropable
int trigger_cmdshort
F-key for trigger injection shortbound-check.
float sbd_damp
set beam default for damping
float dampin
shocks2 & shocks3
float sbd_break
set beam default for breaking threshold
float trigger_switch_state
needed to avoid doubleswitch, bool and timer in one
bool trigger_enabled
general trigger,switch and blocker state
int last_debug_state
smart debug output
float springout
shocks2 & shocks3
float springin
shocks2 & shocks3
float trigger_boundary_t
optional value to tune trigger_switch_state autorelease
float dampout
shocks2 & shocks3
int trigger_cmdlong
F-key for trigger injection longbound-check.
float shock_precompression
Only for export.
float sbd_spring
set beam default for spring
SoundScriptInstancePtr ssi
bool ti_no_self_lock
Attribute.
float ti_min_length
Proportional to orig; length.
ropable_t * ti_locked_ropable
float wh_arg_rim_spring
Not used by 'wheels' (1) and 'meshwheels' (1).
WheelPropulsion wh_propulsed
node_t * wh_near_attach_node
Ogre::Real wh_mass
Total rotational mass of the wheel.
float wh_arg_simple_spring
Whole wheel or just tire, depending on type.
WheelSide wh_arg_side
Only for 'meshwheels*' and 'flexbodywheels'.
node_t * wh_rim_nodes[50]
RigDef::Keyword wh_arg_keyword
float wh_arg_simple_damping
Whole wheel or just tire, depending on type.
NodeNum_t wh_arg_rigidity_node
std::string wh_arg_media1
float wh_arg_rim_damping
Not used by 'wheels' (1) and 'meshwheels' (1).
std::string wh_arg_media2
int wh_beam_start
BeamID to export 'set_beam_defaults' parameters from.