Upload project files
This commit is contained in:
24
Runtime/Cloner/Jobs/TransformAccessJob.cs
Normal file
24
Runtime/Cloner/Jobs/TransformAccessJob.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using Unity.Collections;
|
||||
using Unity.Mathematics;
|
||||
using UnityEngine.Jobs;
|
||||
|
||||
namespace Misaki.ArtTool
|
||||
{
|
||||
public struct TransformAccessJob : IJobParallelForTransform
|
||||
{
|
||||
public NativeArray<float4x4> points;
|
||||
|
||||
public void Execute(int index, TransformAccess transform)
|
||||
{
|
||||
if (index > points.Length || !transform.isValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
MatrixHelper.DecomposeMatrix(points[index], out var position, out var rotation, out var scale);
|
||||
|
||||
transform.SetPositionAndRotation(position, rotation);
|
||||
transform.localScale = scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user