39 bool IsBeam(
const int num);
40 inline void IsDual(
int idx,
bool dual) { m_gun[idx].dual = dual; };
42 void MountGun(
const int num,
const float recharge,
const float lifespan,
const float damage,
const float length,
43 const float width,
const bool mining,
const Color &color,
const float speed,
const bool beam,
const float heatrate,
const float coolrate);
47 inline bool IsGunMounted(
int idx)
const {
return m_gun_present[idx]; }
48 inline float GetGunRange(
int idx)
const {
return m_gun[idx].projData.speed * m_gun[idx].projData.lifespan; };
49 inline float GetProjSpeed(
int idx)
const {
return m_gun[idx].projData.speed; };
61 std::vector<GunLoc> locs;
76 bool m_shouldUseLeadCalc =
false;
79 bool m_firingSolutionOk =
false;
Guns
Definition FixedGuns.h:15
@ GUN_REAR
Definition FixedGuns.h:17
@ GUNMOUNT_MAX
Definition FixedGuns.h:18
@ GUN_FRONT
Definition FixedGuns.h:16
nlohmann::json Json
Definition Json.h:8
Definition DynamicBody.h:15
Definition FixedGuns.h:21
void Init(DynamicBody *b)
Definition FixedGuns.cpp:45
void UnMountGun(int num)
Definition FixedGuns.cpp:157
const vector3d & GetCurrentLeadDir() const
Definition FixedGuns.h:51
bool IsGunMounted(int idx) const
Definition FixedGuns.h:47
virtual ~FixedGuns()
Definition FixedGuns.cpp:23
void SetGunFiringState(int idx, int s)
Definition FixedGuns.cpp:177
bool Fire(int num, Body *ship)
Definition FixedGuns.cpp:183
void UpdateGuns(float timeStep)
Definition FixedGuns.cpp:215
FixedGuns()
Definition FixedGuns.cpp:19
float GetProjSpeed(int idx) const
Definition FixedGuns.h:49
virtual void SaveToJson(Json &jsonObj, Space *space)
Definition FixedGuns.cpp:67
void SetShouldUseLeadCalc(bool enable)
Definition FixedGuns.h:35
void MountGun(const int num, const float recharge, const float lifespan, const float damage, const float length, const float width, const bool mining, const Color &color, const float speed, const bool beam, const float heatrate, const float coolrate)
Definition FixedGuns.cpp:136
void IsDual(int idx, bool dual)
Definition FixedGuns.h:40
virtual void LoadFromJson(const Json &jsonObj, Space *space)
Definition FixedGuns.cpp:82
bool IsFiring()
Definition FixedGuns.cpp:27
void InitGuns(SceneGraph::Model *m)
Definition FixedGuns.cpp:100
bool IsBeam(const int num)
Definition FixedGuns.cpp:40
float GetGunTemperature(int idx) const
Definition FixedGuns.cpp:314
void SetCoolingBoost(float cooler)
Definition FixedGuns.h:53
const vector3d & GetTargetLeadPos() const
Definition FixedGuns.h:50
float GetGunRange(int idx) const
Definition FixedGuns.h:48
bool IsFiringSolutionOk() const
Definition FixedGuns.h:52
void UpdateLead(float timeStep, int num, Body *ship, Body *target)
Definition FixedGuns.cpp:239
Definition RefCounted.h:11
Definition FixedGuns.h:57
vector3d dir
Definition FixedGuns.h:59
vector3d pos
Definition FixedGuns.h:58
Definition Projectile.h:9