Switch points generation from managed thread to unmanaged thread; Change Spline to NativeSpline; Add converter for DistributionMode and update cloner editor ui; Add MeshData type for object distribution calculation; Add ObjectDistributionSetting and ObjectDistributionCalculation(Vertex and Edge Mode);
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Misaki.ArtTool
|
||||
{
|
||||
@@ -10,7 +9,6 @@ namespace Misaki.ArtTool
|
||||
public int3 count;
|
||||
public float3 spacing;
|
||||
public GridShape shape;
|
||||
[Range(0.0f, 1.0f)]
|
||||
public float fill;
|
||||
|
||||
public readonly int DistributionCount => count.x * count.y * count.z;
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Misaki.ArtTool
|
||||
{
|
||||
[Serializable]
|
||||
public struct ObjectDistributionSetting
|
||||
{
|
||||
public MeshFilter meshFilter;
|
||||
public MeshData meshData;
|
||||
public ObjectDistributionMode mode;
|
||||
public int count;
|
||||
public uint seed;
|
||||
public bool alignNormal;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ namespace Misaki.ArtTool
|
||||
[Serializable]
|
||||
public struct SplineDistributionSetting
|
||||
{
|
||||
public SplineContainer spline;
|
||||
public NativeSpline nativeSpline;
|
||||
|
||||
public int indexOffset;
|
||||
|
||||
@@ -26,14 +26,9 @@ namespace Misaki.ArtTool
|
||||
{
|
||||
get
|
||||
{
|
||||
if (spline == null)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (isSpacingMode)
|
||||
{
|
||||
return Mathf.FloorToInt(spline.CalculateLength() / spacing) + 1;
|
||||
return Mathf.FloorToInt(splineLength / spacing) + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user