48 Engine(
float min_rpm,
float max_rpm,
float torque,
float reverse_gear,
float neutral_gear, std::vector<float> gears,
float dratio,
ActorPtr actor);
52 void SetEngineOptions(
float einertia,
char etype,
float eclutch,
float ctime,
float stime,
float pstime,
float irpm,
float srpm,
float maximix,
float minimix,
float ebraking);
53 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);
130 void pushNetworkState(
float engine_rpm,
float acc,
float clutch,
int gear,
bool running,
bool contact,
char auto_mode,
char auto_select = -1);
Central state/object manager and communications hub.
Self reference-counting objects, as requred by AngelScript garbage collector.
Softbody object; can be anything from soda can to a space shuttle Constructed from a truck definition...
Processes a RigDef::Document (parsed from 'truck' file format) into a simulated gameplay object (Acto...
A land vehicle engine + transmission.
float m_tcase_ratio
Engine.
float m_engine_addi_torque[MAXTURBO]
void setWheelSpin(float rpm)
float getCurEngineTorque()
float m_engine_shiftup_rpm
Shift down RPM ('engine' attr #1)
void autoShiftSet(int mode)
char getEngineType() const
't' = truck (default), 'c' = car, 'e' = electric car ('engoption' attr #2)
void pushNetworkState(float engine_rpm, float acc, float clutch, int gear, bool running, bool contact, char auto_mode, char auto_select=-1)
float getEngineInertia() const
('engoption' attr #1)
float m_antilag_power_factor
std::deque< float > m_rpms
char m_engine_type
't' = truck (default), 'c' = car ('engoption' attr #2)
void UpdateInputEvents(float dt)
float m_cur_engine_torque
Engine.
float m_one_third_rpm_range
float m_hydropump_state
Engine.
SimGearboxMode getAutoMode()
float getAccToHoldRPM()
estimate required throttle input to hold the current rpm
void setGearRange(int v)
low level gear changing (bypasses shifting logic)
void startEngine()
Quick engine start. Plays sounds.
float getClutchForce() const
('engoption' attr #3)
float m_cur_wheel_revolutions
Gears; measured wheel revolutions.
int m_engine_turbo_mode
Engine attribute.
float getStallRPM() const
('engoption' attr #7)
float m_diff_ratio
Global gear ratio ('engine' attr #4)
float m_engine_inertia
('engoption' attr #1)
float m_antilag_rand_chance
float m_min_wastegate_psi
float m_cur_engine_rpm
Engine.
float getMinIdleMixture() const
Minimum throttle to maintain the idle RPM ('engoption' attr #10)
float getIdleRPM() const
('engoption' attr #8)
float m_engine_idle_rpm
('engoption' attr #8)
bool m_turbo_has_wastegate
bool m_engine_has_air
Engine attribute.
float m_max_idle_mixture
Maximum throttle to maintain the idle RPM ('engoption' attr #9)
void setHydroPump(float work)
void SetEngineOptions(float einertia, char etype, float eclutch, float ctime, float stime, float pstime, float irpm, float srpm, float maximix, float minimix, float ebraking)
void setTCaseRatio(float ratio)
Set current transfer case gear (reduction) ratio.
void UpdateEngine(float dt, int doUpdate)
int getUpshiftDelayCounter()
bool m_contact
Ignition switch is in ON/RUN position.
std::deque< float > m_accs
float m_cur_turbo_rpm[MAXTURBO]
std::deque< float > m_brakes
float getDiffRatio() const
Global gear ratio ('engine' attr #4)
TorqueCurve * m_torque_curve
void offStart()
Quick start of vehicle engine.
float m_turbo_wg_threshold_n
float getBrakingTorque() const
float getEngineTorque() const
Torque in N/m ('engine' attr #3)
float m_braking_torque
Engine attribute.
int m_cur_gear
Gears; Current gear {-1 = reverse, 0 = neutral, 1...21 = forward}.
int m_cur_gear_range
Gears.
float getShiftDownRPM() const
Shift down RPM ('engine' attr #1)
float m_turbo_bov_rpm[MAXTURBO]
int getKickdownDelayCounter()
int m_kickdown_delay_counter
float getMaxIdleMixture() const
Maximum throttle to maintain the idle RPM ('engoption' attr #9)
float getPostShiftClock()
float m_turbo_wg_threshold_p
float m_turbo_engine_rpm_operation
float getAutoShiftBehavior()
TorqueCurve * getTorqueCurve()
float m_shift_time
Time (in seconds) that it takes to shift ('engoption' attr #4)
float getShiftUpRPM() const
Shift up RPM ('engine' attr #2)
float m_clutch_time
Time (in seconds) the clutch takes to apply ('engoption' attr #5)
void setGear(int v)
low level gear changing (bypasses shifting logic)
bool m_engine_has_turbo
Engine attribute.
std::vector< float > m_gear_ratios
[R|N|1|...] ('engine' attrs #4[global],#5[R],#6[N],#7[1]...)
void autoSetAcc(float val)
float m_cur_clutch_torque
float m_ref_wheel_revolutions
Gears; estimated wheel revolutions based on current vehicle speed along the longi....
float m_min_idle_mixture
Minimum throttle to maintain the idle RPM ('engoption' attr #10)
void stopEngine()
stall engine
int m_num_gears
Num. forward gears.
bool m_starter
Ignition switch is in START position.
SimGearboxMode m_auto_mode
int m_upshift_delay_counter
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)
float m_clutch_force
('engoption' attr #3)
float getClutchTime() const
Time (in seconds) the clutch takes to apply ('engoption' attr #5)
void setAutoMode(SimGearboxMode mode)
void setManualClutch(float val)
bool m_engine_is_priming
Engine.
void shift(int val)
Changes gear by a relative offset. Plays sounds.
bool m_engine_is_electric
Engine attribute.
void setClutch(float clutch)
float m_post_shift_time
Time (in seconds) until full torque is transferred ('engoption' attr #6)
bool m_engine_is_running
Engine state.
void toggleContact()
Ignition.
void updateShifts()
Changes gears. Plays sounds.
float m_engine_max_rpm
Shift up RPM ('engine' attr #2)
float m_engine_stall_rpm
('engoption' attr #7)
int getNumGearsRanges() const
float getShiftTime() const
Time (in seconds) that it takes to shift ('engoption' attr #4)
float m_turbo_inertia_factor
float m_engine_torque
Torque in N/m ('engine' attr #3)
void shiftTo(int val)
Changes gear to given value. Plays sounds.
float getWheelSpin() const
Wheel RPM.
float getPostShiftTime() const
Time (in seconds) until full torque is transferred ('engoption' attr #6)
float getGearRatio(int pos)
-1=R, 0=N, 1... ('engine' attrs #5[R],#6[N],#7[1]...)
bool hasContact()
Ignition.
This class loads and processes a torque curve for a vehicle.