MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WriteHeight

Function WriteHeight

Source/Engine/Terrain/TerrainPatch.cpp:252–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250}
251
252FORCE_INLINE void WriteHeight(const TerrainDataUpdateInfo& info, Color32& raw, const float height)
253{
254 const float normalizedHeight = (height - info.PatchOffset) / info.PatchHeight;
255 const uint16 quantizedHeight = (uint16)(normalizedHeight * MAX_uint16);
256
257 raw.R = (uint8)(quantizedHeight & 0xff);
258 raw.G = (uint8)((quantizedHeight >> 8) & 0xff);
259}
260
261FORCE_INLINE float ReadNormalizedHeight(const Color32& raw)
262{

Callers 1

UpdateHeightMapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected