41#include <rapidjson/document.h>
606 Ogre::BillboardSet *
bbs =
nullptr;
853 std::shared_ptr<rapidjson::Document>
877 std::shared_ptr<rapidjson::Document>
Central state/object manager and communications hub.
Global forward declarations.
static const int MAX_COMMANDS
maximum number of commands per actor
For backwards compatibility of the 'triggers' feature, the commandkey array must support negative ind...
command_t & operator[](int index)
std::unordered_map< int, command_t > m_virtualkey
Negative-indexed commandkeys.
std::array< command_t, MAX_COMMANDS+1 > m_commandkey
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Designed to be run in physics loop (2khz)
Designed to be run on main/rendering loop (FPS)
std::vector< collision_box_t * > CollisionBoxPtrVec
ActorType
< Aka 'Driveable'
@ HYDRO_FLAG_REV_ELEVATOR
@ UNLOCKED
lock not locked
@ PRELOCK
prelocking, attraction forces in action
@ TRUCK
its a truck (or other land vehicle)
@ NOT_DRIVEABLE
not drivable at all
@ AIRPLANE
its an airplane
@ AI
machine controlled by an Artificial Intelligence
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 BEAM_PLASTIC_COEF_DEFAULT
static const float BEAM_BREAK
@ BEAM_VIRTUAL
Excluded from mass calculations, visuals permanently disabled.
@ TOWARDS_COORDS
Constant force directed towards ffc_target_coords
@ HALFBEAM_ROPE
Like TOWARDS_NODE, but parametrized like a rope-beam in truck fileformat.
@ CONSTANT
Constant force given by direction and magnitude.
@ HALFBEAM_GENERIC
Like TOWARDS_NODE, but parametrized like a beam in truck fileformat.
@ TOWARDS_NODE
Constant force directed towards ffc_target_node
@ SHOCK1
either 'shock1' (with flag BEAM_HYDRO) or a wheel beam
@ LOCAL_SIMULATED
simulated (local) actor
@ LOCAL_SLEEPING
sleeping (local) actor
@ NETWORKED_OK
not simulated (remote) actor
@ DISPOSED
removed from simulation, still in memory to satisfy pointers.
@ NETWORKED_HIDDEN
not simulated, not updated (remote)
@ 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
static const NodeNum_t NODENUM_INVALID
int ActorInstanceID_t
Unique sequentially generated ID of an actor in session. Use ActorManager::GetActorById()
int FreeForceID_t
Unique sequentially generated ID of FreeForce; use ActorManager::GetFreeForceNextId().
WheelSide
Used by rig-def/addonpart/tuneup formats to specify wheel rim mesh orientation.
ActorSimAttr
Parameter to Actor::setSimAttribute() and Actor::getSimAttribute(); allows advanced users to tweak ph...
@ ACTORSIMATTR_ENGOPTION_MIN_IDLE_MIXTURE
Min throttle to maintain idle RPM - Param #10 of 'engoption'.
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_N
1 - WgThreshold ~ calculated from Param #10 of 'engturbo2'
@ ACTORSIMATTR_ENGOPTION_BRAKING_TORQUE
How much engine brakes on zero throttle - Param #11 of 'engoption'.
@ ACTORSIMATTR_ENGINE_TORQUE
Engine torque in newton-meters (N/m) - Param #3 of 'engine'.
@ ACTORSIMATTR_ENGOPTION_CLUTCH_FORCE
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_CHANCE
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_THRESHOLD_P
1 + WgThreshold ~ calculated from Param #10 of 'engturbo2'
@ ACTORSIMATTR_ENGOPTION_CLUTCH_TIME
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_MAX_PSI
@ ACTORSIMATTR_ENGOPTION_ENGINE_TYPE
@ ACTORSIMATTR_ENGTURBO2_WASTEGATE_ENABLED
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_POWER
@ ACTORSIMATTR_ENGTURBO2_INERTIA_FACTOR
Time to spool up - Param #2 of 'engturbo2'.
@ ACTORSIMATTR_ENGOPTION_POST_SHIFT_TIME
Time (in seconds) until full torque is transferred - Param #6 of 'engoption'.
@ ACTORSIMATTR_ENGTURBO2_BOV_MIN_PSI
Blow-off valve PSI threshold - Param #7 of 'engturbo2'.
@ ACTORSIMATTR_ENGINE_GEAR_RATIOS_ARRAY
Gearbox - Format: "<reverse_gear> <neutral_gear> <forward_gear 1> [<forward gear 2>]....
@ ACTORSIMATTR_TC_PULSE_TIME
Pulse duration in seconds, safe values <0.00005 - 1>
@ ACTORSIMATTR_ENGOPTION_STALL_RPM
RPM where engine stalls - Param #7 of 'engoption'.
@ ACTORSIMATTR_ENGOPTION_MAX_IDLE_MIXTURE
Max throttle to maintain idle RPM - Param #9 of 'engoption'.
@ ACTORSIMATTR_ENGTURBO2_NUM_TURBOS
Number of turbos - Param #3 of 'engturbo2'.
@ ACTORSIMATTR_ENGOPTION_ENGINE_INERTIA
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_MIN_RPM
@ ACTORSIMATTR_TC_WHEELSLIP_CONSTANT
Minimum wheel slip threshold, safe value = 0.25.
@ ACTORSIMATTR_ENGTURBO2_MAX_RPM
MaxPSI * 10000 ~ calculated from Param #4 of 'engturbo2'.
@ ACTORSIMATTR_ENGOPTION_IDLE_RPM
Target idle RPM - Param #8 of 'engoption'.
@ ACTORSIMATTR_ENGTURBO2_ANTILAG_ENABLED
@ ACTORSIMATTR_ENGINE_SHIFTUP_RPM
Automatic transmission - Param #2 of 'engine'.
@ ACTORSIMATTR_ENGTURBO2_BOV_ENABLED
Blow-off valve - Param #6 of 'engturbo2'.
@ ACTORSIMATTR_ENGTURBO2_ENGINE_RPM_OP
Engine RPM threshold for turbo to operate - Param #5 of 'engturbo2'.
@ ACTORSIMATTR_ENGOPTION_SHIFT_TIME
@ ACTORSIMATTR_TC_RATIO
Regulating force, safe values: <1 - 20>
@ ACTORSIMATTR_ENGINE_SHIFTDOWN_RPM
Automatic transmission - Param #1 of 'engine'.
@ ACTORSIMATTR_ENGINE_DIFF_RATIO
Differential ratio (aka global gear ratio) - Param #4 of 'engine'.
static const ActorInstanceID_t ACTORINSTANCEID_INVALID
int CommandkeyID_t
Index into Actor::ar_commandkeys (BEWARE: indexed 1-MAX_COMMANDKEYS, 0 is invalid value,...
CollisionEventFilter
Specified in terrain object (.ODEF) file, syntax: 'event <type> <filter>'.
@ EVENT_ALL
(default) ~ Triggered by any node on any vehicle
@ EVENT_TRUCK_WHEELS
'truck_wheels' ~ Triggered only by wheel nodes of land vehicle (ActorType::TRUCK)
@ EVENT_AIRPLANE
'airplane' ~ Triggered by any node of airplane (ActorType::AIRPLANE)
@ EVENT_AVATAR
'avatar' ~ Triggered by the character only
@ EVENT_TRUCK
'truck' ~ Triggered by any node of land vehicle (ActorType::TRUCK)
@ EVENT_NONE
Invalid value.
@ EVENT_BOAT
'boat' ~ Triggered by any node of boats (ActorType::BOAT)
uint16_t NodeNum_t
Node position within Actor::ar_nodes; use RoR::NODENUM_INVALID as empty value.
const char * ActorSimAttrToString(ActorSimAttr attr)
static const CommandkeyID_t COMMANDKEYID_INVALID
static const FreeForceID_t FREEFORCEID_INVALID
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
ActorLinkingRequestType alr_type
ActorInstanceID_t alr_actor_instance_id
NodeNum_t alr_hook_mousenode
ActorInstanceID_t amr_actor
Ogre::Quaternion amr_softrespawn_rotation
Rotation to use with SOFT_RESPAWN; use TObjParser::CalcRotation() to calculate quaternion from XYZ li...
Ogre::Vector3 amr_softrespawn_position
Position to use with SOFT_RESPAWN.
CacheEntryPtr amr_addonpart
Primary method of specifying cache entry.
std::shared_ptr< rapidjson::Document > amr_saved_state
std::string amr_addonpart_fname
Fallback method in case CacheEntry doesn't exist anymore - that means mod was uninstalled in the mean...
@ RELOAD
Full reload from filesystem, requested by user.
@ SOFT_RESPAWN
Like hard reset, but positions the actor like spawn process does - using the relative positions from ...
@ REFRESH_VISUALS
Forces a synchronous update of visuals from any context - i.e. from terrain editor mode or with sleep...
std::string asr_net_username
CacheEntryPtr asr_cache_entry
Optional, overrides 'asr_filename' and 'asr_cache_entry_num'.
TuneupDefPtr asr_working_tuneup
Only filled when editing tuneup via Tuning menu.
bool asr_terrn_machine
This is a fixed machinery.
Ogre::Vector3 asr_position
CacheEntryPtr asr_skin_entry
ActorInstanceID_t asr_instance_id
Optional; see ActorManager::GetActorNextInstanceID();.
std::string asr_filename
Can be in "Bundle-qualified" format, i.e. "mybundle.zip:myactor.truck".
Ogre::Quaternion asr_rotation
Origin
< Enables special processing
@ CONFIG_FILE
'Preselected vehicle' in RoR.cfg or command line
@ NETWORK
Remote controlled.
@ USER
Direct selection by user via GUI.
@ SAVEGAME
User spawned and part of a savegame.
@ TERRN_DEF
Preloaded with terrain.
BitMask_t asr_net_peeropts
RoRnet::PeerOptions to be applied after spawn.
collision_box_t * asr_spawnbox
CacheEntryPtr asr_tuneup_entry
Only filled when user selected a saved/downloaded .tuneup mod in SelectorUI.
std::shared_ptr< rapidjson::Document > asr_saved_state
Pushes msg MODIFY_ACTOR (type RESTORE_SAVED) after spawn.
bool asr_free_position
Disables the automatic spawn position adjustment.
Global force affecting particular (base) node of particular (base) actor; added ad-hoc by scripts.
float ffc_halfb_minmaxposnegstress
Ogre::Vector3 ffc_force_const_direction
Expected to be normalized; only effective with FreeForceType::CONSTANT
Ogre::Vector3 ffc_target_coords
float ffc_force_magnitude
float ffc_halfb_L
Length at rest, including permanent deformations.
ActorPtr ffc_target_actor
float ffc_halfb_maxposstress
float ffc_halfb_maxnegstress
float ffc_halfb_strength
Breaking threshold.
float ffc_halfb_plastic_coef
NodeNum_t ffc_target_node
Common for ADD and MODIFY requests; tailored for use with AngelScript thru GameScript::pushMessage().
double ffr_force_magnitude
double ffr_halfb_strength
Ogre::Vector3 ffr_target_coords
double ffr_halfb_plastic_coef
double ffr_halfb_diameter
Ogre::Vector3 ffr_force_const_direction
User input state for animated props with 'source:event'.
UI helper for displaying command control keys to user.
std::string uckp_description
Simulation: An edge in the softbody structure.
float debug_v
debug shock velocity
float refL
reference length
ActorPtr bm_locked_actor
in case p2 is on another actor
float debug_d
debug shock damping
float default_beam_deform
for reset
int detacher_group
Attribute: detacher group number (integer)
float initial_beam_strength
for reset
float debug_k
debug shock spring_rate
bool bm_inter_actor
in case p2 is on another actor
float default_beam_diameter
for export only
Ogre::Vector3 campos
camera position
std::string reverb_preset_name
name of the reverb preset that applies to the inside of the collision box
Ogre::Vector3 hi
absolute collision box
Ogre::Vector3 relo
relative collision box
Ogre::Quaternion selfunrot
self rotation
Ogre::Vector3 center
center of rotation
Ogre::Vector3 rehi
relative collision box
Ogre::Quaternion rot
rotation
Ogre::Vector3 debug_verts[8]
box corners in absolute world position
Ogre::Quaternion unrot
rotation
Ogre::Quaternion selfrot
self rotation
Ogre::Vector3 selfcenter
center of self rotation
Ogre::Vector3 lo
absolute collision box
CollisionEventFilter event_filter
RoR::CmdKeyInertia rotator_inertia
RoR::CmdKeyInertia command_inertia
std::vector< commandbeam_t > beams
bool trigger_cmdkeyblock_state
identifies blocked F-commands for triggers
std::vector< int > rotators
bool pressed_center_mode
State.
bool auto_move_lock
State.
int8_t auto_moving_mode
State.
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.
Surface friction properties.
Ogre::ColourValue fx_colour
float fluid_density
Density of liquid.
float ms
static friction coefficient
float fx_particle_timedelta
delta for particle animation
float flow_behavior_index
if flow_behavior_index<1 then liquid is Pseudoplastic (ketchup, whipped cream, paint) if =1 then liqu...
float t2
hydrodynamic friction (s/m)
float flow_consistency_index
general drag coefficient
float solid_ground_level
how deep the solid ground is
float vs
stribeck velocity (m/s)
int fx_particle_amount
amount of particles
float drag_anisotropy
Upwards/Downwards drag anisotropy.
float fx_particle_velo_factor
velocity factor
float fx_particle_min_velo
minimum velocity to display sparks
float strength
ground strength
float mc
sliding friction coefficient
float va
adhesion velocity
float fx_particle_fade
fade coefficient
float fx_particle_max_velo
maximum velocity to display sparks
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)
bool nd_has_ground_contact
Physics state.
static const int8_t INVALID_BBOX
Ogre::Real nd_avg_collision_slip
Physics state; average slip velocity across the last few physics frames.
Ogre::Vector3 nd_last_collision_force
Physics state; last collision force.
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)
bool nd_has_mesh_contact
Physics state.
bool nd_under_water
State; GFX hint.
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)
Ogre::Vector3 nd_last_collision_slip
Physics state; last collision slip vector.
bool nd_immovable
Attr; User-defined.
bool nd_cab_node
Attr; This node is part of collision triangle.
ground_model_t * nd_last_collision_gm
Physics state; last collision 'ground model' (surface definition)
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
Ogre::Real wh_tc_coef
Sim state; Current traction control modulation ratio.
Ogre::Real wh_speed
Current wheel speed in m/s.
Ogre::Real wh_last_torque
Last internal forces (engine / brakes / diffs)
float wh_arg_rim_spring
Not used by 'wheels' (1) and 'meshwheels' (1).
Ogre::Real wh_last_retorque
Last external forces (friction, ...)
WheelPropulsion wh_propulsed
Ogre::Vector3 debug_force
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
Ogre::Real wh_avg_speed
Internal physics state; Do not read from this.
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
Ogre::Vector3 debug_scaled_cforce
Ogre::Real wh_alb_coef
Sim state; Current anti-lock brake modulation ratio.
Ogre::Real wh_torque
Internal physics state; Do not read from this.
int wh_beam_start
BeamID to export 'set_beam_defaults' parameters from.