// 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 ToolMaterial = nullptr; UPROPERTY(Category = "Tool Preview Settings", EditAnywhere, BlueprintReadWrite, meta = (HideInPanel)) TObjectPtr 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; };