2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-20 21:44:18 +00:00
|
|
|
|
2019-09-23 19:00:23 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <string_view>
|
|
|
|
|
|
|
|
#include "Runtime/GCNTypes.hpp"
|
|
|
|
#include "Runtime/World/CActor.hpp"
|
2016-04-20 21:44:18 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
namespace urde {
|
2018-05-14 03:38:36 +00:00
|
|
|
class CElementGen;
|
|
|
|
class CParticleElectric;
|
2019-09-23 19:00:23 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CScriptEffect : public CActor {
|
|
|
|
static u32 g_NumParticlesUpdating;
|
|
|
|
static u32 g_NumParticlesRendered;
|
|
|
|
TLockedToken<CElectricDescription> xe8_electricToken;
|
|
|
|
std::unique_ptr<CParticleElectric> xf4_electric;
|
|
|
|
TLockedToken<CGenDescription> xf8_particleSystemToken;
|
|
|
|
std::unique_ptr<CElementGen> x104_particleSystem;
|
|
|
|
TUniqueId x108_lightId = kInvalidUniqueId;
|
|
|
|
CAssetId x10c_partId;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
bool x110_24_enable : 1;
|
|
|
|
bool x110_25_noTimerUnlessAreaOccluded : 1;
|
|
|
|
bool x110_26_rebuildSystemsOnActivate : 1;
|
|
|
|
bool x110_27_useRateInverseCamDist : 1;
|
|
|
|
bool x110_28_combatVisorVisible : 1;
|
|
|
|
bool x110_29_thermalVisorVisible : 1;
|
|
|
|
bool x110_30_xrayVisorVisible : 1;
|
|
|
|
bool x110_31_anyVisorVisible : 1;
|
|
|
|
bool x111_24_useRateCamDistRange : 1;
|
|
|
|
bool x111_25_dieWhenSystemsDone : 1;
|
|
|
|
bool x111_26_canRender : 1;
|
2018-05-18 04:16:33 +00:00
|
|
|
};
|
2018-12-08 05:30:43 +00:00
|
|
|
u32 _dummy = 0;
|
|
|
|
};
|
|
|
|
float x114_rateInverseCamDist;
|
|
|
|
float x118_rateInverseCamDistSq;
|
|
|
|
float x11c_rateInverseCamDistRate;
|
|
|
|
float x120_rateCamDistRangeMin;
|
|
|
|
float x124_rateCamDistRangeMax;
|
|
|
|
float x128_rateCamDistRangeFarRate;
|
|
|
|
float x12c_remTime;
|
|
|
|
float x130_duration;
|
|
|
|
float x134_durationResetWhileVisible;
|
|
|
|
std::unique_ptr<CActorLights> x138_actorLights;
|
|
|
|
TUniqueId x13c_triggerId = kInvalidUniqueId;
|
|
|
|
float x140_destroyDelayTimer = 0.f;
|
|
|
|
|
2016-04-20 21:44:18 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CScriptEffect(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf,
|
|
|
|
const zeus::CVector3f& scale, CAssetId partId, CAssetId elscId, bool hotInThermal,
|
|
|
|
bool noTimerUnlessAreaOccluded, bool rebuildSystemsOnActivate, bool active, bool useRateInverseCamDist,
|
|
|
|
float rateInverseCamDist, float rateInverseCamDistRate, float duration, float durationResetWhileVisible,
|
|
|
|
bool useRateCamDistRange, float rateCamDistRangeMin, float rateCamDistRangeMax,
|
|
|
|
float rateCamDistRangeFarRate, bool combatVisorVisible, bool thermalVisorVisible, bool xrayVisorVisible,
|
|
|
|
const CLightParameters& lParms, bool dieWhenSystemsDone);
|
2017-01-15 03:07:01 +00:00
|
|
|
|
2019-08-09 12:45:18 +00:00
|
|
|
void Accept(IVisitor& visitor) override;
|
|
|
|
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&) override;
|
|
|
|
void PreRender(CStateManager&, const zeus::CFrustum&) override;
|
2020-04-05 11:54:02 +00:00
|
|
|
void AddToRenderer(const zeus::CFrustum&, CStateManager&) override;
|
2020-04-09 17:28:20 +00:00
|
|
|
void Render(CStateManager&) override;
|
2019-08-09 12:45:18 +00:00
|
|
|
void Think(float, CStateManager&) override;
|
|
|
|
bool CanRenderUnsorted(const CStateManager&) const override { return false; }
|
|
|
|
void SetActive(bool active) override {
|
2018-12-08 05:30:43 +00:00
|
|
|
CActor::SetActive(active);
|
|
|
|
xe7_29_drawEnabled = true;
|
|
|
|
}
|
2019-08-09 12:45:18 +00:00
|
|
|
void CalculateRenderBounds() override;
|
|
|
|
zeus::CAABox GetSortingBounds(const CStateManager&) const override;
|
2019-08-14 10:04:11 +00:00
|
|
|
bool AreBothSystemsDeleteable() const;
|
2018-12-08 05:30:43 +00:00
|
|
|
static void ResetParticleCounts() {
|
|
|
|
g_NumParticlesUpdating = 0;
|
|
|
|
g_NumParticlesRendered = 0;
|
|
|
|
}
|
2016-04-20 21:44:18 +00:00
|
|
|
};
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
} // namespace urde
|