18 , _quadtreeNode(parentNode)
19 , _parentTerrain(parentTerrain)
35 const vec2<U32> heightmapDataSize = HMSize / div;
36 const U32 nHMWidth = heightmapDataSize.
x;
37 const U32 nHMHeight = heightmapDataSize.
y;
41 for (
U16 j = 0; j < nHMHeight - 1; ++j) {
42 const U32 jOffset = j * offset+pos.
y;
43 for (
U16 i = 0; i < nHMWidth; ++i) {
44 const U32 iOffset = i * offset+pos.
x;
45 U32 idx = iOffset + jOffset * HMSize.
x;
46 F32 height = verts[idx]._position.y;
48 if (height > tempMax) {
51 if (height < tempMin) {
56 idx = iOffset + (jOffset + offset) * HMSize.
x;
57 height = verts[idx]._position.y;
59 if (height > tempMax) {
62 if (height < tempMin) {
91 _vegetation = std::make_unique<VegetationInstance>( context, handle,
this );
static void registerTerrainChunk(Terrain &terrain, Divide::TerrainChunk *const chunk)
void setMin(const vec3< F32 > &min) noexcept
const vec3< F32 > & getMax() const noexcept
const vec3< F32 > & getMin() const noexcept
void setMax(const vec3< F32 > &max) noexcept
Rough around the edges Adapter pattern abstracting the actual rendering API and access to the GPU.
void drawBBox(GFXDevice &context)
const BoundingBox & getBoundingBox() const noexcept
QuadtreeNode & _quadtreeNode
void initVegetation(PlatformContext &context, Handle< Vegetation > handle)
TerrainChunk(Terrain *parentTerrain, QuadtreeNode &parentNode) noexcept
const BoundingBox & bounds() const noexcept
void load(U8 depth, const vec2< U32 > pos, U32 targetChunkDimension, vec2< U32 > HMSize, BoundingBox &bbInOut)
void drawBBox(GFXDevice &context) const
VegetationInstance_uptr _vegetation
Handle console commands that start with a forward slash.
constexpr U32 to_U32(const T value)
constexpr F32 to_F32(const T value)
eastl::vector< Type > vector