mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-23 19:36:18 -05:00
33 lines
954 B
C#
33 lines
954 B
C#
using Unity.Collections;
|
|
using UnityEngine.Jobs;
|
|
using UniGLTF.SpringBoneJobs.Blittables;
|
|
#if ENABLE_SPRINGBONE_BURST
|
|
using Unity.Burst;
|
|
#endif
|
|
|
|
namespace UniGLTF.SpringBoneJobs
|
|
{
|
|
|
|
#if ENABLE_SPRINGBONE_BURST
|
|
[BurstCompile]
|
|
#endif
|
|
public struct PullTransformJob : IJobParallelForTransform
|
|
{
|
|
[WriteOnly] public NativeArray<BlittableTransform> Transforms;
|
|
|
|
public void Execute(int index, TransformAccess transform)
|
|
{
|
|
Transforms[index] = new BlittableTransform(
|
|
position: transform.position,
|
|
rotation: transform.rotation,
|
|
localPosition: transform.localPosition,
|
|
|
|
localRotation: transform.localRotation,
|
|
localScale: transform.localScale,
|
|
localToWorldMatrix: transform.localToWorldMatrix,
|
|
worldToLocalMatrix: transform.worldToLocalMatrix
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|