2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2017-07-16 06:13:37 +00:00
|
|
|
|
2019-09-22 21:52:05 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <optional>
|
|
|
|
|
|
|
|
#include "Runtime/CToken.hpp"
|
|
|
|
#include "Runtime/RetroTypes.hpp"
|
|
|
|
#include "Runtime/Particle/CElementGen.hpp"
|
|
|
|
#include "Runtime/Particle/CParticleElectric.hpp"
|
|
|
|
#include "Runtime/Particle/CParticleSwoosh.hpp"
|
|
|
|
#include "Runtime/World/CEffect.hpp"
|
|
|
|
|
|
|
|
#include <zeus/CVector3f.hpp>
|
2017-07-16 06:13:37 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2017-07-16 06:13:37 +00:00
|
|
|
class CGenDescription;
|
|
|
|
class CElectricDescription;
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CHUDBillboardEffect : public CEffect {
|
|
|
|
std::unique_ptr<CParticleGen> xe8_generator;
|
|
|
|
zeus::CVector3f xec_translation;
|
|
|
|
zeus::CVector3f xf8_localScale;
|
2020-04-20 04:57:50 +00:00
|
|
|
bool x104_24_renderAsParticleGen : 1 = true;
|
|
|
|
bool x104_25_enableRender : 1 = false;
|
|
|
|
bool x104_26_isElementGen : 1 = false;
|
|
|
|
bool x104_27_runIndefinitely : 1 = false;
|
2018-12-08 05:30:43 +00:00
|
|
|
float x108_timeoutTimer = 0.f;
|
|
|
|
static u32 g_IndirectTexturedBillboardCount;
|
|
|
|
static u32 g_BillboardCount;
|
|
|
|
static float CalcGenRate();
|
|
|
|
|
2017-07-16 06:13:37 +00:00
|
|
|
public:
|
2019-06-12 02:05:17 +00:00
|
|
|
CHUDBillboardEffect(const std::optional<TToken<CGenDescription>>& particle,
|
|
|
|
const std::optional<TToken<CElectricDescription>>& electric, TUniqueId uid,
|
2018-12-08 05:30:43 +00:00
|
|
|
bool active, std::string_view name, float dist, const zeus::CVector3f& scale0,
|
|
|
|
const zeus::CColor& color, const zeus::CVector3f& scale1, const zeus::CVector3f& translation);
|
2019-08-09 12:45:18 +00:00
|
|
|
~CHUDBillboardEffect() override;
|
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void Think(float dt, CStateManager& mgr) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
|
2019-08-09 12:45:18 +00:00
|
|
|
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager& mgr) override;
|
2018-12-08 05:30:43 +00:00
|
|
|
bool IsElementGen() const { return x104_26_isElementGen; }
|
|
|
|
void SetRunIndefinitely(bool b) { x104_27_runIndefinitely = b; }
|
|
|
|
CParticleGen* GetParticleGen() const { return xe8_generator.get(); }
|
2017-07-16 06:13:37 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
static float GetNearClipDistance(CStateManager& mgr);
|
|
|
|
static zeus::CVector3f GetScaleForPOV(CStateManager& mgr);
|
2017-07-16 06:13:37 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|