实体
水面 CWaterLevel
水面高度、波浪与渲染入口
CWaterLevel.h
水面高度、波浪、渲染入口。贴水、游泳、船相关判断常用。
取水面高度
GetWaterLevel / GetWaterLevelNoWaves
成功写 *pWaterZ。
static bool GetWaterLevel(/* 重载见头文件:坐标 + out Z + 波浪相关 */);
static bool GetWaterLevelNoWaves(float x, float y, float z, float* pWaterZ);波浪叠加
AddWaveToResult / CalculateWavesOnlyForCoordinate
static void AddWaveToResult(float x, float y, float* pWaterZ, float BigWavesAmpl, float SmallWavesAmpl, CVector* pNormal);
static void CalculateWavesOnlyForCoordinate(int32_t X, int32_t Y, float BigWavesAmpl, float SmallWavesAmpl, float* pResultHeight);配置与顶点
m_nWaterConfiguration / ChangeWaterConfiguration
static int& m_nWaterConfiguration;
static void ChangeWaterConfiguration(int32_t NewWaterConfig);
static int& m_nNumOfWaterTriangles;
static int& m_nNumOfWaterQuads;
static int& m_nNumOfWaterVertices;
static std::array<CWaterVertex, 1021>& m_aVertices;沙滩玩具
CreateBeachToy
static CObject* CreateBeachToy(const CVector* pos, eBeachToy beachToy);渲染入口
RenderWater / PreRenderWater
一般只 hook 观察,别每帧瞎调。
static void PreRenderWater();
static void RenderWater();
static void RenderTransparentWater();
static void RenderWaterFog();