mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-29 06:13:21 -05:00
Merge branch 'master' into texture-marknonreadable
This commit is contained in:
@@ -300,6 +300,7 @@ namespace UniGLTF.SpringBoneJobs
|
||||
public void Execute(int springIndex)
|
||||
{
|
||||
var spring = Springs[springIndex];
|
||||
var center = spring.centerTransformIndex >= 0 ? Transforms[spring.centerTransformIndex] : (BlittableTransform?)null;
|
||||
for (int jointIndex = spring.logicSpan.startIndex; jointIndex < spring.logicSpan.EndIndex; ++jointIndex)
|
||||
{
|
||||
if (float.IsNaN(CurrentTails[jointIndex].x))
|
||||
@@ -317,9 +318,10 @@ namespace UniGLTF.SpringBoneJobs
|
||||
}
|
||||
|
||||
var tail = Transforms[tailIndex];
|
||||
CurrentTails[jointIndex] = tail.position;
|
||||
PrevTails[jointIndex] = tail.position;
|
||||
NextTails[jointIndex] = tail.position;
|
||||
var tailPos = center.HasValue ? center.Value.worldToLocalMatrix.MultiplyPoint3x4(tail.position) : tail.position;
|
||||
CurrentTails[jointIndex] = tailPos;
|
||||
PrevTails[jointIndex] = tailPos;
|
||||
NextTails[jointIndex] = tailPos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,8 +69,9 @@ namespace UniGLTF
|
||||
public NativeArray<T> CreateNativeArray<T>(ArraySegment<T> data) where T : struct
|
||||
{
|
||||
var array = CreateNativeArray<T>(data.Count);
|
||||
for (int i = 0; i < data.Count; i++)
|
||||
array[i] = data.Array[data.Offset + i];
|
||||
var toSpan = array.AsSpan();
|
||||
var fromSpan = data.AsSpan();
|
||||
fromSpan.CopyTo(toSpan);
|
||||
return array;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user