metaforce/Runtime/World/CHUDBillboardEffect.hpp

47 lines
1.7 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2017-07-16 06:13:37 +00:00
#include "RetroTypes.hpp"
#include "World/CEffect.hpp"
#include "CToken.hpp"
#include "Particle/CElementGen.hpp"
#include "Particle/CParticleElectric.hpp"
#include "Particle/CParticleSwoosh.hpp"
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;
bool x104_24_renderAsParticleGen : 1;
bool x104_25_enableRender : 1;
bool x104_26_isElementGen : 1;
bool x104_27_runIndefinitely : 1;
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:
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);
~CHUDBillboardEffect();
void Accept(IVisitor& visitor);
void Think(float dt, CStateManager& mgr);
void AddToRenderer(const zeus::CFrustum& frustum, const CStateManager& mgr) const;
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum);
void Render(const CStateManager& mgr) const;
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