metaforce/Runtime/World/CHUDBillboardEffect.hpp

52 lines
1.9 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 <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
2021-04-10 08:42:06 +00:00
namespace metaforce {
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 = 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:
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() override;
void Accept(IVisitor& visitor) override;
void Think(float dt, CStateManager& mgr) override;
void AddToRenderer(const zeus::CFrustum& frustum, CStateManager& mgr) override;
void PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) override;
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
};
2021-04-10 08:42:06 +00:00
} // namespace metaforce