naev 0.11.5
pilot_heat.h
1/*
2 * See Licensing and Copyright notice in naev.h
3 */
4#pragma once
5
6#include "pilot.h"
7
8/*
9 * Fundamental heat properties.
10 */
11#define HEAT_WORST_ACCURACY (38./180.*M_PI)
13/*
14 * Some random physics constants.
15 */
16#define CONST_STEFAN_BOLTZMANN (5.67e-8)
17#define CONST_SPACE_TEMP (3.18)
18#define CONST_SPACE_TEMP_4 \
19(CONST_SPACE_TEMP*CONST_SPACE_TEMP*CONST_SPACE_TEMP*CONST_SPACE_TEMP)
20#define CONST_SPACE_STAR_TEMP (250.)
21#define CONST_SPACE_STAR_TEMP_4 \
22(CONST_SPACE_STAR_TEMP*CONST_SPACE_STAR_TEMP*CONST_SPACE_STAR_TEMP*CONST_SPACE_STAR_TEMP)
24/*
25 * Properties of steel.
26 *
27 * Yes, there are many different types of steels, these are sort of "average values" for carbon steel.
28 */
29#define STEEL_HEAT_CONDUCTIVITY (54.)
30#define STEEL_HEAT_CAPACITY (0.49)
31#define STEEL_DENSITY (7.88e3)
33/*
34 * Outfit core value calculations.
35 */
36double pilot_heatCalcOutfitC( const Outfit *o );
37double pilot_heatCalcOutfitArea( const Outfit *o );
38
39/*
40 * Heat initializations.
41 */
42void pilot_heatCalc( Pilot *p );
44
45/*
46 * Heat management.
47 */
48void pilot_heatReset( Pilot *p );
49void pilot_heatAddSlot( const Pilot *p, PilotOutfitSlot *o );
50void pilot_heatAddSlotTime( const Pilot *p, PilotOutfitSlot *o, double dt );
51double pilot_heatUpdateSlot( const Pilot *p, PilotOutfitSlot *o, double dt );
52void pilot_heatUpdateShip( Pilot *p, double Q_cond, double dt );
54
55/*
56 * Modifiers.
57 */
58double pilot_heatEfficiencyMod( double T, double Tb, double Tc );
59double pilot_heatAccuracyMod( double T );
60double pilot_heatFireRateMod( double T );
61double pilot_heatFirePercent( double T );
void pilot_heatAddSlot(const Pilot *p, PilotOutfitSlot *o)
Adds heat to an outfit slot.
Definition pilot_heat.c:133
double pilot_heatEfficiencyMod(double T, double Tb, double Tc)
Returns a 0:1 modifier representing efficiency (1. being normal).
Definition pilot_heat.c:235
void pilot_heatUpdateCooldown(Pilot *p)
Overrides the usual heat model during active cooldown.
Definition pilot_heat.c:245
double pilot_heatFireRateMod(double T)
Returns a 0:1 modifier representing fire rate (1. being normal).
Definition pilot_heat.c:285
void pilot_heatCalcSlot(PilotOutfitSlot *o)
Calculates the heat parameters for a pilot's slot.
Definition pilot_heat.c:83
void pilot_heatReset(Pilot *p)
Resets a pilot's heat.
Definition pilot_heat.c:101
double pilot_heatAccuracyMod(double T)
Returns a 0:1 modifier representing accuracy (0. being normal).
Definition pilot_heat.c:277
void pilot_heatUpdateShip(Pilot *p, double Q_cond, double dt)
Heats the pilot's ship.
Definition pilot_heat.c:213
double pilot_heatCalcOutfitC(const Outfit *o)
Calculates the thermal mass of an outfit.
Definition pilot_heat.c:62
void pilot_heatCalc(Pilot *p)
Calculates the heat parameters for a pilot.
Definition pilot_heat.c:33
double pilot_heatCalcOutfitArea(const Outfit *o)
Calculates the effective transfer area of an outfit.
Definition pilot_heat.c:73
double pilot_heatUpdateSlot(const Pilot *p, PilotOutfitSlot *o, double dt)
Heats the pilot's slot.
Definition pilot_heat.c:180
double pilot_heatFirePercent(double T)
Returns a 0:2 level of fire, 0:1 is the accuracy point, 1:2 is fire rate point.
Definition pilot_heat.c:293
void pilot_heatAddSlotTime(const Pilot *p, PilotOutfitSlot *o, double dt)
Adds heat to an outfit slot over a period of time.
Definition pilot_heat.c:152
A ship outfit, depends radically on the type.
Definition outfit.h:328
Stores an outfit the pilot has.
Definition pilot.h:108
The representation of an in-game pilot.
Definition pilot.h:217