Fix error amd Update features.

Changed Span<PointData> to ReadOnlySpan<PointData> on method Operate in EffectorBase.cs
Changed the return type of method Operate in EffectorBase.cs from void to PointDate
Added FieldHelper and BlendField function to make the blending work.
This commit is contained in:
Misaki
2024-09-18 19:49:32 +09:00
parent 0ae44d6139
commit 4a15d63447
10 changed files with 97 additions and 47 deletions

View File

@@ -56,10 +56,7 @@ namespace Misaki.ArtTool
effectorMatrix = transform.localToWorldMatrix;
}
public virtual void Operate(int index, float4x4 nodeWorldMatrix, Span<PointData> points)
{
}
public abstract PointData Operate(int index, float4x4 nodeWorldMatrix, ReadOnlySpan<PointData> points);
protected float CalculateFieldsWeight(float3 worldPosition)
{
@@ -73,7 +70,8 @@ namespace Misaki.ArtTool
continue;
}
weight = math.lerp(weight, fieldData.field.Operate(worldPosition), fieldData.opacity);
//weight = math.lerp(weight, fieldData.field.Operate(worldPosition), fieldData.opacity);
weight = FieldHelper.BlendField(weight, fieldData.field.Operate(worldPosition), fieldData.opacity, fieldData.blending);
}
weight *= strength;

View File

@@ -1,6 +0,0 @@
namespace Misaki.ArtTool
{
public class IterateEffectorBase : EffectorBase
{
}
}

View File

@@ -1,2 +0,0 @@
fileFormatVersion: 2
guid: 5144695703dc3434c93bc038017a3ac3