CelticCraft/Plugins/VoxelFree/Source/Voxel/Public/VoxelTools/Tools/VoxelLevelTool.h

48 lines
1.6 KiB
C
Raw Permalink Normal View History

2023-07-03 16:17:13 +00:00
// Copyright 2020 Phyronnaz
#pragma once
#include "CoreMinimal.h"
#include "VoxelTools/Tools/VoxelToolBase.h"
#include "VoxelLevelTool.generated.h"
UCLASS()
class VOXEL_API UVoxelLevelTool : public UVoxelToolBase
{
GENERATED_BODY()
public:
UPROPERTY(Category = "Tool Preview Settings", EditAnywhere, BlueprintReadWrite, meta = (HideInPanel))
TObjectPtr<UMaterialInterface> ToolMaterial = nullptr;
UPROPERTY(Category = "Tool Preview Settings", EditAnywhere, BlueprintReadWrite, meta = (HideInPanel))
TObjectPtr<UStaticMesh> CylinderMesh = nullptr;
public:
UPROPERTY(Category = "Tool Settings", EditAnywhere, BlueprintReadWrite, meta = (UIMin = "0", UIMax = "1"))
float Falloff = 0.1;
UPROPERTY(Category = "Tool Settings", EditAnywhere, BlueprintReadWrite, meta = (UIMin = "0", UIMax = "10000"))
float Height = 1000.f;
// Offset, relative to the height
UPROPERTY(Category = "Tool Settings", EditAnywhere, BlueprintReadWrite, meta = (UIMin = "0", UIMax = "1"))
float Offset = 1.f;
// Relative to the radius
UPROPERTY(Category = "Tool Settings", EditAnywhere, BlueprintReadWrite, meta = (UIMin=0, UIMax=1))
float Stride = 0.f;
public:
UVoxelLevelTool();
//~ Begin UVoxelToolBase Interface
virtual void GetToolConfig(FVoxelToolBaseConfig& OutConfig) const override;
virtual void Tick() override;
virtual void UpdateRender(UMaterialInstanceDynamic* OverlayMaterialInstance, UMaterialInstanceDynamic* MeshMaterialInstance) override;
virtual FVoxelIntBoxWithValidity DoEdit() override;
//~ End UVoxelToolBase Interface
private:
FVector GetToolOffset() const;
};