naev 0.12.6
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 \
12 ( 38. / 180. * M_PI )
13
14/*
15 * Some random physics constants.
16 */
17#define CONST_STEFAN_BOLTZMANN \
18 ( 5.67e-8 )
20#define CONST_SPACE_TEMP \
21 ( 3.18 )
22#define CONST_SPACE_TEMP_4 \
23 ( CONST_SPACE_TEMP * CONST_SPACE_TEMP * CONST_SPACE_TEMP * \
24 CONST_SPACE_TEMP )
25#define CONST_SPACE_STAR_TEMP \
26 ( 250. )
27#define CONST_SPACE_STAR_TEMP_4 \
28 ( CONST_SPACE_STAR_TEMP * CONST_SPACE_STAR_TEMP * CONST_SPACE_STAR_TEMP * \
29 CONST_SPACE_STAR_TEMP )
30
31/*
32 * Properties of steel.
33 *
34 * Yes, there are many different types of steels, these are sort of "average
35 * values" for carbon steel.
36 */
37#define STEEL_HEAT_CONDUCTIVITY \
38 ( 54. )
39#define STEEL_HEAT_CAPACITY \
40 ( 0.49 )
41#define STEEL_DENSITY ( 7.88e3 )
42
43/*
44 * Outfit core value calculations.
45 */
46double pilot_heatCalcOutfitC( const Outfit *o );
47double pilot_heatCalcOutfitArea( const Outfit *o );
48
49/*
50 * Heat initializations.
51 */
52void pilot_heatCalc( Pilot *p );
54
55/*
56 * Heat management.
57 */
58void pilot_heatReset( Pilot *p );
59void pilot_heatAddSlot( const Pilot *p, PilotOutfitSlot *o );
60void pilot_heatAddSlotTime( const Pilot *p, PilotOutfitSlot *o, double dt );
61double pilot_heatUpdateSlot( const Pilot *p, PilotOutfitSlot *o, double dt );
62void pilot_heatUpdateShip( Pilot *p, double Q_cond, double dt );
64
65/*
66 * Modifiers.
67 */
68double pilot_heatEfficiencyMod( double T, double Tb, double Tc );
69double pilot_heatAccuracyMod( double T );
70double pilot_heatFireRateMod( double T );
71double pilot_heatFirePercent( double T );
void pilot_heatAddSlot(const Pilot *p, PilotOutfitSlot *o)
Adds heat to an outfit slot.
Definition pilot_heat.c:135
double pilot_heatEfficiencyMod(double T, double Tb, double Tc)
Returns a 0:1 modifier representing efficiency (1. being normal).
Definition pilot_heat.c:237
void pilot_heatUpdateCooldown(Pilot *p)
Overrides the usual heat model during active cooldown.
Definition pilot_heat.c:247
double pilot_heatFireRateMod(double T)
Returns a 0:1 modifier representing fire rate (1. being normal).
Definition pilot_heat.c:289
void pilot_heatCalcSlot(PilotOutfitSlot *o)
Calculates the heat parameters for a pilot's slot.
Definition pilot_heat.c:85
void pilot_heatReset(Pilot *p)
Resets a pilot's heat.
Definition pilot_heat.c:103
double pilot_heatAccuracyMod(double T)
Returns a 0:1 modifier representing accuracy (0. being normal).
Definition pilot_heat.c:281
void pilot_heatUpdateShip(Pilot *p, double Q_cond, double dt)
Heats the pilot's ship.
Definition pilot_heat.c:215
double pilot_heatCalcOutfitC(const Outfit *o)
Calculates the thermal mass of an outfit.
Definition pilot_heat.c:63
void pilot_heatCalc(Pilot *p)
Calculates the heat parameters for a pilot.
Definition pilot_heat.c:32
double pilot_heatCalcOutfitArea(const Outfit *o)
Calculates the effective transfer area of an outfit.
Definition pilot_heat.c:75
double pilot_heatUpdateSlot(const Pilot *p, PilotOutfitSlot *o, double dt)
Heats the pilot's slot.
Definition pilot_heat.c:182
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:298
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:154
A ship outfit, depends radically on the type.
Definition outfit.h:372
Stores an outfit the pilot has.
Definition pilot.h:145
The representation of an in-game pilot.
Definition pilot.h:263