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

@@ -21,21 +21,21 @@ namespace Misaki.ArtTool
public float3 scale;
public float uniformScale;
public override void Operate(int index, float4x4 nodeWorldMatrix, Span<PointData> points)
public override PointData Operate(int index, float4x4 nodeWorldMatrix, ReadOnlySpan<PointData> points)
{
var currentPoint = points[index];
if (!isEnablePosition && !isEnableRotation && !isEnableScale)
{
return;
return currentPoint;
}
var currentPoint = points[index];
MatrixHelper.DecomposeMatrix(currentPoint.matrix, out var position, out var rotation, out var scale);
var weight = CalculateFieldsWeight(position);
if (weight == 0)
{
return;
return currentPoint;
}
if (isEnablePosition)
@@ -96,7 +96,7 @@ namespace Misaki.ArtTool
currentPoint.matrix = float4x4.TRS(position, rotation, scale);
points[index] = currentPoint;
return currentPoint;
}
}
}