metaforce/Runtime/World/CScriptWater.hpp

106 lines
3.8 KiB
C++
Raw Normal View History

2016-04-17 02:50:45 +00:00
#ifndef __URDE_CSCRIPTWATER_HPP__
#define __URDE_CSCRIPTWATER_HPP__
2016-04-20 05:44:08 +00:00
#include "CScriptTrigger.hpp"
2016-11-20 21:53:15 +00:00
#include "CFluidPlaneCPU.hpp"
2016-04-17 02:50:45 +00:00
namespace urde
{
2016-04-20 05:44:08 +00:00
class CDamageInfo;
class CFluidUVMotion;
class CScriptWater : public CScriptTrigger
2016-04-17 02:50:45 +00:00
{
2016-11-20 21:53:15 +00:00
private:
static const float kSplashScales[6];
u32 x150_ = 0;
std::unique_ptr<CFluidPlaneCPU> x1b4_fluidPlane;
2016-11-20 21:53:15 +00:00
zeus::CVector3f x1b8_;
float x1f4_;
2017-08-08 06:03:57 +00:00
float x1f8_lightmapDoubleBlendFactor = 0.f;
2016-11-20 21:53:15 +00:00
zeus::CVector3f x1d4_;
2017-06-12 04:23:34 +00:00
std::list<std::pair<TUniqueId, bool>> x1fc_waterInhabitants;
2016-11-20 21:53:15 +00:00
u32 x210_;
float x214_;
float x218_;
float x21c_;
float x220_;
float x224_;
zeus::CColor x228_;
u32 x22c_;
u32 x230_;
u32 x234_;
u32 x238_;
u32 x248_;
u32 x24c_;
2017-08-02 07:13:11 +00:00
std::experimental::optional<TLockedToken<CGenDescription>> x250_visorRunoffEffect;
u16 x260_;
u16 x262_visorRunoffSfx;
2016-11-20 21:53:15 +00:00
u32 x264_ = 0;
TLockedToken<CParticleGen> x268_splashEffects[5];
2017-08-02 07:13:11 +00:00
u16 x29c_splashSounds[5];
u32 x2c0_tesselationSize;
u32 x2c4_gridDimX = 0;
u32 x2c8_gridDimY = 0;
u32 x2cc_gridCellCount = 0;
std::unique_ptr<bool[]> x2d8_gridFlags;
std::unique_ptr<bool[]> x2e0_;
u32 x2e4_gridCellCount2 = 0;
union
{
struct
{
bool x2e8_24 : 1;
bool x2e8_25 : 1;
bool x2e8_26 : 1;
bool x2e8_27 : 1;
bool x2e8_28 : 1;
};
u32 _dummy = 0;
};
void SetupGrid(bool b);
2016-04-20 05:44:08 +00:00
public:
2016-11-20 21:53:15 +00:00
CScriptWater(CStateManager&, TUniqueId, const std::string& name, const CEntityInfo&, const zeus::CVector3f&,
const zeus::CAABox&, CDamageInfo const&, zeus::CVector3f&, ETriggerFlags, bool, bool, ResId, ResId, ResId, ResId,
ResId, ResId, ResId, const zeus::CVector3f&, float, float, float, bool, CFluidPlane::EFluidType, bool,
float, const CFluidUVMotion&, float, float, float, float, float, float, float, float,
const zeus::CColor&, const zeus::CColor&, ResId, ResId, ResId, ResId, ResId, s32, s32, s32, s32, s32,
float, u32, float, float, float, float, float, float, float, float, const zeus::CColor&, ResId, float,
float, float, u32, u32, bool, s32, s32, const u32*);
2016-04-17 02:50:45 +00:00
2016-11-20 21:53:15 +00:00
void Think(float, CStateManager&);
void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&);
2017-02-11 00:52:52 +00:00
void PreRender(CStateManager &, const zeus::CFrustum &);
2016-11-20 21:53:15 +00:00
void AddToRenderer(const zeus::CFrustum&, const CStateManager&) const;
void Render(const CStateManager&) const;
void Touch(CActor &, CStateManager &);
void CalculateRenderBounds();
zeus::CAABox GetSortingBounds(const CStateManager&) const;
void RenderSurface();
EWeaponCollisionResponseTypes GetCollisionResponseType(const zeus::CVector3f&, const zeus::CVector3f&, CWeaponMode&,
int);
void UpdateSplashInhabitants(CStateManager&);
s16 GetSplashSound(float) const;
const TLockedToken<CParticleGen>& GetSplashEffect(float) const;
float GetSplashEffectScale(float) const;
u32 GetSplashIndex(float) const;
void FluidPlane();
zeus::CPlane GetWRSurfacePlane() const;
float GetSurfaceZ() const;
bool IsMorphing() const;
void SetMorphing(bool);
zeus::CColor GetSplashColor() const;
void SetFrustumPlanes(const zeus::CFrustum& frustum);
const zeus::CFrustum& GetFrustumPlanes() const;
CFluidPlaneCPU& GetFluidPlane() const { return *x1b4_fluidPlane; }
2017-08-02 07:13:11 +00:00
const std::experimental::optional<TLockedToken<CGenDescription>>& GetVisorRunoffEffect() const
{ return x250_visorRunoffEffect; }
u16 GetVisorRunoffSfx() const { return x262_visorRunoffSfx; }
2017-08-08 06:03:57 +00:00
const CScriptWater* GetNextConnectedWater(const CStateManager& mgr) const;
float GetLightmapDoubleBlendFactor() const { return x1f8_lightmapDoubleBlendFactor; }
2016-11-20 21:53:15 +00:00
};
2016-04-17 02:50:45 +00:00
}
#endif // __URDE_CSCRIPTWATER_HPP__