CelticCraft/Plugins/VoxelFree/Source/Voxel/Private/VoxelTools/VoxelToolsBase.cpp

26 lines
736 B
C++
Raw Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#include "VoxelTools/Gen/VoxelToolsBase.h"
template<typename T>
FVoxelIntBox GetModifiedVoxelsBounds(const TArray<T>& ModifiedVoxels)
{
FVoxelIntBoxWithValidity Bounds;
for (auto& ModifiedVoxel : ModifiedVoxels)
{
Bounds += ModifiedVoxel.Position;
}
return Bounds.IsValid() ? Bounds.GetBox() : FVoxelIntBox();
}
FVoxelIntBox UVoxelToolsBase::GetModifiedVoxelValuesBounds(const TArray<FModifiedVoxelValue>& ModifiedVoxels)
{
VOXEL_FUNCTION_COUNTER();
return GetModifiedVoxelsBounds(ModifiedVoxels);
}
FVoxelIntBox UVoxelToolsBase::GetModifiedVoxelMaterialsBounds(const TArray<FModifiedVoxelMaterial>& ModifiedVoxels)
{
VOXEL_FUNCTION_COUNTER();
return GetModifiedVoxelsBounds(ModifiedVoxels);
}