Added object distributuon calculationg
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
28
Runtime/Cloner/Contracts/Field/IFieldLayer.cs
Normal file
28
Runtime/Cloner/Contracts/Field/IFieldLayer.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Runtime/Cloner/Contracts/Field/IFieldLayer.cs.meta
Normal file
2
Runtime/Cloner/Contracts/Field/IFieldLayer.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1155a51cb3c944442b68146ffde0edc8
|
||||
15
Runtime/Cloner/Contracts/Field/ModifierBase.cs
Normal file
15
Runtime/Cloner/Contracts/Field/ModifierBase.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
2
Runtime/Cloner/Contracts/Field/ModifierBase.cs.meta
Normal file
2
Runtime/Cloner/Contracts/Field/ModifierBase.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f0813bb760ec42440a4ebe667f0339cc
|
||||
Reference in New Issue
Block a user