40 const BitMask_t nodeflags = RigDef::Node::Ref::REGULAR_STATE_IS_VALID;
72 if (beam_defaults->springiness != b_spring
73 || beam_defaults->damping_constant != b_damp
74 || beam_defaults->deformation_threshold != b_deform
75 || beam_defaults->breaking_threshold != b_break
76 || beam_defaults->visual_beam_diameter != b_diameter)
78 beam_defaults = std::shared_ptr<BeamDefaults>(
new BeamDefaults);
79 beam_defaults->springiness = b_spring;
80 beam_defaults->damping_constant = b_damp;
81 beam_defaults->deformation_threshold = b_deform;
82 beam_defaults->breaking_threshold = b_break;
83 beam_defaults->visual_beam_diameter = b_diameter;
93 if (node_defaults->load_weight != n_loadweight
94 || node_defaults->friction != n_friction
95 || node_defaults->surface != n_surface
96 || node_defaults->volume != n_volume)
98 node_defaults = std::shared_ptr<NodeDefaults>(
new NodeDefaults);
99 node_defaults->load_weight = n_loadweight;
100 node_defaults->friction = n_friction;
101 node_defaults->surface = n_surface;
102 node_defaults->volume = n_volume;
113 if (inertia_defaults->start_delay_factor != start_delay
114 || inertia_defaults->stop_delay_factor != stop_delay
115 || inertia_defaults->start_function != startfn
116 || inertia_defaults->stop_function != stopfn
119 inertia_defaults = std::shared_ptr<Inertia>(
new Inertia);
120 inertia_defaults->start_delay_factor = start_delay;
121 inertia_defaults->stop_delay_factor = stop_delay;
122 inertia_defaults->start_function = startfn;
123 inertia_defaults->stop_function = stopfn;
154 auto node_defaults = std::shared_ptr<NodeDefaults>(
new NodeDefaults);
157 auto default_minimass = std::shared_ptr<DefaultMinimass>(
new DefaultMinimass());
161 auto beam_defaults = std::shared_ptr<BeamDefaults>(
new BeamDefaults);
164 beam_defaults->deformation_threshold =
BEAM_DEFORM;
165 beam_defaults->breaking_threshold =
BEAM_BREAK;
169 auto inertia_defaults = std::shared_ptr<Inertia>(
new Inertia);
188 if (default_minimass->min_mass_Kg !=
ar_minimass[i])
190 default_minimass = std::shared_ptr<DefaultMinimass>(
new DefaultMinimass());
231 if (detacher_group !=
ar_beams[i].detacher_group)
279 std::array<int, 8> cinecam_nodes = { -1, -1, -1, -1, -1, -1, -1, -1 };
280 int num_cinecam_nodes = 0;
281 int cinecam_beamid = -1;
305 for (
int n = 0; n < 8; n++)
327 case Keyword::WHEELS:
357 case Keyword::WHEELS2:
390 case Keyword::MESHWHEELS:
422 case Keyword::MESHWHEELS2:
458 case Keyword::FLEXBODYWHEELS:
627 int i = hydrobeam.hb_beam_index;
static void UpdateSetInertiaDefaults(std::shared_ptr< Inertia > &inertia_defaults, Actor *actor, CmdKeyInertia &cmdkey_inertia)
static bool IsActuallyShockBeam(const beam_t &beam)
static RigDef::Node::Ref BuildNodeRef(Actor *actor, NodeNum_t n)
static void UpdateSetBeamDefaults(std::shared_ptr< BeamDefaults > &beam_defaults, Actor *actor, int i)
static void UpdateSetNodeDefaults(std::shared_ptr< NodeDefaults > &node_defaults, Actor *actor, NodeNum_t i)
Central state/object manager and communications hub.
#define ROR_ASSERT(_EXPR)
#define BITMASK_IS_1(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.
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
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...
Softbody object; can be anything from soda can to a space shuttle Constructed from a truck definition...
std::vector< float > ar_minimass
minimum node mass in Kg - can be scaled in-game via NBUtil
float ar_dry_mass
User-defined (editable via NBUtil); from 'globals' arg#1 - default for all nodes.
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).
wheel_t ar_wheels[MAX_WHEELS]
std::vector< BitMask_t > ar_nodes_options
merged options from 'nodes' and 'set_node_defaults'
std::vector< bool > ar_beams_user_defined
True for 'beams', false for wheels/cinecam/hooknode/wings/rotators etc...
int * ar_nodes_id
Number in truck file, -1 for nodes generated by wheels/cinecam.
std::vector< float > ar_nodes_default_loadweights
'set_node_defaults': load weight.
float ar_load_mass
User-defined (editable via NBUtil); from 'globals' arg#2 - only applies to nodes with 'l' flag.
void propagateNodeBeamChangesToDef()
Back-propagates changes done by N/B-utils UI to the def-document.
std::string * ar_nodes_name
Name in truck file, only if defined with 'nodes2'.
CacheEntryPtr m_used_actor_entry
Required.
std::vector< hydrobeam_t > ar_hydros
Ogre::Vector3 * ar_nodes_spawn_offsets
Relative positions (incl. Tuning system tweaks) from the definition file, for spawn-like resetting (i...
RigDef::DocumentPtr actor_def
Cached actor definition (aka truckfile) after first spawn.
Designed to be run in physics loop (2khz)
const std::string & GetStopFunction() const
float GetStartDelay() const
const std::string & GetStartFunction() const
float GetStopDelay() const
@ HYDRO_FLAG_REV_ELEVATOR
static const float DEFAULT_SPRING
static const float DEFAULT_BEAM_DIAMETER
5 centimeters default beam width
static const int DEFAULT_DETACHER_GROUP
static const float BEAM_DEFORM
static const float DEFAULT_DAMP
static const float DEFAULT_MINIMASS
minimum node mass in Kg
static const float BEAM_BREAK
@ SHOCK1
either 'shock1' (with flag BEAM_HYDRO) or a wheel beam
static const NodeNum_t NODENUM_INVALID
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
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
bool _has_extension_break_limit
std::shared_ptr< BeamDefaults > defaults
float extension_break_limit
static const BitMask_t OPTION_i_INVISIBLE
static const BitMask_t OPTION_s_SUPPORT
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< NodeDefaults > node_defaults
Ogre::String tyre_mesh_name
Ogre::String rim_mesh_name
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_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
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< BeamDefaults > beam_defaults
std::shared_ptr< DefaultMinimass > default_minimass
bool _has_load_weight_override
std::shared_ptr< NodeDefaults > node_defaults
float load_weight_override
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
float spring_in
Spring value applied when the shock is compressing.
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...
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.
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"...
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.
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
Ogre::String face_material_name
Ogre::String band_material_name
Ogre::String band_material_name
Ogre::String face_material_name
Simulation: An edge in the softbody structure.
float default_beam_deform
for reset
int detacher_group
Attribute: detacher group number (integer)
float initial_beam_strength
for reset
float default_beam_diameter
for export only
< beams updating length based on simulation variables, generally known as actuators.
NodeNum_t pos
This node's index in Actor::ar_nodes array.
float sbd_damp
set beam default for damping
float dampin
shocks2 & shocks3
float sbd_break
set beam default for breaking threshold
float springout
shocks2 & shocks3
float springin
shocks2 & shocks3
float dampout
shocks2 & shocks3
float shock_precompression
Only for export.
float sbd_spring
set beam default for spring
float wh_arg_rim_spring
Not used by 'wheels' (1) and 'meshwheels' (1).
WheelPropulsion wh_propulsed
Ogre::Real wh_mass
Total rotational mass of the wheel.
WheelSide wh_arg_side
Only for 'meshwheels*' and 'flexbodywheels'.
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.