Added object distributuon calculationg

This commit is contained in:
Misaki
2024-09-22 00:11:03 +09:00
parent 77d16fbffa
commit df0194ff9c
22 changed files with 375 additions and 100 deletions

View File

@@ -6,29 +6,13 @@ namespace Misaki.ArtTool
{
public abstract class FieldBase : MonoBehaviour
{
public RemappingSetting remappingSetting = new();
public EventHandler propertyChanged;
public virtual void Initialize()
{
}
public abstract float Operate(float3 position);
protected float Remapping(float weight)
{
if (!remappingSetting.enable)
{
return weight;
}
weight = math.saturate(weight / (1.0f - remappingSetting.innerOffset));
weight = math.lerp(remappingSetting.min, remappingSetting.max, weight);
weight = remappingSetting.invert ? 1.0f - weight : weight;
weight *= remappingSetting.strength;
return weight;
}
public abstract float Operate(float3 position, float weight);
private void Update()
{

View File

@@ -0,0 +1,28 @@
using System;
using Unity.Mathematics;
namespace Misaki.ArtTool
{
public interface IFieldLayer
{
public EventHandler PropertyChanged
{
get;
set;
}
public virtual void Initialize()
{
}
public virtual float Operate(float3 position)
{
return 0.0f;
}
public virtual float Operate(float weight)
{
return weight;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1155a51cb3c944442b68146ffde0edc8

View File

@@ -0,0 +1,15 @@
using System;
namespace Misaki.ArtTool.Packages
{
public abstract class ModifierBase : IFieldLayer
{
public EventHandler PropertyChanged
{
get;
set;
}
public abstract float Operate(float weight);
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: f0813bb760ec42440a4ebe667f0339cc