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

@@ -5,6 +5,8 @@ namespace Misaki.ArtTool
{
public class SphereField : FieldBase
{
public RemappingSetting remappingSetting = new();
public float radius = 1.0f;
private float3 fieldPosition;
@@ -14,10 +16,10 @@ namespace Misaki.ArtTool
fieldPosition = transform.position;
}
public override float Operate(float3 position)
public override float Operate(float3 position, float weight)
{
var weight = ShapeHelper.Linear01DistanceToSphereCenter(position, fieldPosition, radius);
weight = Remapping(weight);
weight = ShapeHelper.Linear01DistanceToSphereCenter(position, fieldPosition, radius);
weight = FieldHelper.ApplyRemapping(weight, ref remappingSetting);
return weight;
}