CelticCraft/Plugins/VoxelFree/Source/VoxelGraph/Public/VoxelNodes/VoxelHeightmapSamplerNode.h

47 lines
1.6 KiB
C
Raw Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "VoxelExposedNodes.h"
#include "VoxelEnums.h"
#include "VoxelHeightmapSamplerNode.generated.h"
class UVoxelHeightmapAssetFloat;
class UVoxelHeightmapAssetUINT16;
// Heightmap sampler
UCLASS(DisplayName = "Heightmap Sampler", Category = "Heightmap")
class VOXELGRAPH_API UVoxelNode_HeightmapSampler : public UVoxelExposedNode
{
GENERATED_BODY()
GENERATED_VOXELNODE_BODY()
public:
UPROPERTY()
bool bFloatHeightmap = false;
UPROPERTY(EditAnywhere, Category = "Heightmap settings", meta = (DisplayName = "Heightmap (float)", EditCondition = "bFloatHeightmap"))
TObjectPtr<UVoxelHeightmapAssetFloat> HeightmapFloat;
UPROPERTY(EditAnywhere, Category = "Heightmap settings", meta = (DisplayName = "Heightmap (uint16)", EditCondition = "!bFloatHeightmap"))
TObjectPtr<UVoxelHeightmapAssetUINT16> HeightmapUINT16;
UPROPERTY(EditAnywhere, Category = "Heightmap settings")
EVoxelSamplerMode SamplerType = EVoxelSamplerMode::Tile;
// If true, the heightmap will be centered
UPROPERTY(EditAnywhere, Category = "Heightmap settings")
bool bCenter = false;
UVoxelNode_HeightmapSampler();
//~ Begin UVoxelNode Interface
virtual FText GetTitle() const override;
virtual void LogErrors(FVoxelGraphErrorReporter& ErrorReporter) override;
//~ End UVoxelNode Interface
//~ Begin UVoxelExposedNode Interface
virtual FName GetParameterPropertyName() const override { return bFloatHeightmap ? GET_OWN_MEMBER_NAME(HeightmapFloat) : GET_OWN_MEMBER_NAME(HeightmapUINT16); }
//~ End UVoxelExposedNode Interface
};