CelticCraft/Plugins/VoxelFree/Source/Voxel/Private/VoxelRender/IVoxelLODManager.cpp

35 lines
1.1 KiB
C++
Raw Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#include "VoxelRender/IVoxelLODManager.h"
#include "VoxelRender/IVoxelRenderer.h"
#include "VoxelData/VoxelData.h"
#include "VoxelWorld.h"
FVoxelLODSettings::FVoxelLODSettings(
const AVoxelWorld* InWorld,
EVoxelPlayType PlayType,
const TVoxelSharedRef<IVoxelRenderer>& Renderer,
const TVoxelSharedRef<IVoxelPool>& Pool,
const FVoxelData* Data)
: Renderer(Renderer)
, Pool(Pool)
, VoxelSize(InWorld->VoxelSize)
, OctreeDepth(FVoxelUtilities::ClampDepth<RENDER_CHUNK_SIZE>(FMath::Max(1, Data
? FVoxelUtilities::ConvertDepth<DATA_CHUNK_SIZE, RENDER_CHUNK_SIZE>(Data->Depth)
: InWorld->RenderOctreeDepth)))
, WorldBounds(Data
? Data->WorldBounds
: InWorld->GetWorldBounds())
, bConstantLOD(PlayType == EVoxelPlayType::Game
? InWorld->bConstantLOD
: false)
, bStaticWorld(PlayType == EVoxelPlayType::Game
? InWorld->bStaticWorld
: false)
, MinDelayBetweenLODUpdates(InWorld->MinDelayBetweenLODUpdates)
, bEnableTransitions(InWorld->bEnableTransitions)
, bInvertTransitions(InWorld->RenderType == EVoxelRenderType::SurfaceNets)
, World(InWorld->GetWorld())
{
}