metaforce/Runtime/World/CFluidPlane.hpp

65 lines
2.3 KiB
C++
Raw Normal View History

2016-04-20 05:44:08 +00:00
#ifndef __URDE_CFLUIDPLANE_HPP__
#define __URDE_CFLUIDPLANE_HPP__
2016-11-20 21:53:15 +00:00
#include "RetroTypes.hpp"
#include "CToken.hpp"
#include "Graphics/CTexture.hpp"
#include "CFluidUVMotion.hpp"
#include "zeus/CAABox.hpp"
#include "zeus/CFrustum.hpp"
2016-04-20 05:44:08 +00:00
namespace urde
{
2016-11-20 21:53:15 +00:00
class CFluidUVMotion;
class CRippleManager;
class CScriptWater;
class CStateManager;
2016-04-20 05:44:08 +00:00
class CFluidPlane
{
public:
enum class EFluidType
2016-11-20 21:53:15 +00:00
{
Zero,
One,
Two,
Three,
Four,
Five
};
private:
ResId x4_texPattern1Id;
ResId x8_texPattern2Id;
ResId xc_texColorId;
std::experimental::optional<TLockedToken<CTexture>> x10_texPattern1;
std::experimental::optional<TLockedToken<CTexture>> x20_texPattern2;
std::experimental::optional<TLockedToken<CTexture>> x30_texColor;
float x40_alpha;
2017-06-12 04:23:34 +00:00
EFluidType x44_fluidType;
float x48_f2;
CFluidUVMotion x4c_uvMotion;
2016-11-20 21:53:15 +00:00
public:
CFluidPlane(ResId texPattern1, ResId texPattern2, ResId texColor, float alpha, EFluidType fluidType,
float f2, const CFluidUVMotion& motion);
2016-11-20 21:53:15 +00:00
virtual void Ripple(float mag, TUniqueId rippler, const zeus::CVector3f& pos,
CScriptWater& water, CStateManager& mgr);
2016-11-20 21:53:15 +00:00
virtual void Update();
virtual void Render(const CStateManager& mgr, const zeus::CAABox& aabb, const zeus::CTransform& xf,
const zeus::CTransform& areaXf, bool noSubdiv, const zeus::CFrustum& frustum,
const std::experimental::optional<CRippleManager>& rippleManager, TUniqueId waterId,
const bool* gridFlags, u32 gridDimX, u32 gridDimY, const zeus::CVector3f& areaCenter) const {}
float GetAlpha() const { return x40_alpha; }
2017-06-12 04:23:34 +00:00
EFluidType GetFluidType() const { return x44_fluidType; }
const CFluidUVMotion& GetUVMotion() const { return x4c_uvMotion; }
const CTexture& GetColorTexture() const { return **x30_texColor; }
bool HasColorTexture() const { return x30_texColor.operator bool(); }
const CTexture& GetTexturePattern1() const { return **x10_texPattern1; }
bool HasTexturePattern1() const { return x10_texPattern1.operator bool(); }
const CTexture& GetTexturePattern2() const { return **x20_texPattern2; }
bool HasTexturePattern2() const { return x20_texPattern2.operator bool(); }
2016-04-20 05:44:08 +00:00
};
}
#endif // __URDE_CFLUIDPLANE_HPP__