mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-11 21:14:19 -05:00
fix UNSIGNED_BYTE4 joints
This commit is contained in:
parent
9bf6f45efc
commit
85fb330c8b
|
|
@ -122,7 +122,20 @@ namespace VrmLib
|
|||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Stride:{Stride}!= sizeof({typeof(T).Name}:{Marshal.SizeOf(typeof(T))}");
|
||||
if (typeof(T) == typeof(SkinJoints) && Stride == 4)
|
||||
{
|
||||
// 例えば SkinJoints を使う JOINTS_0 は UNSIGNED_BYTE と UNSIGNED_SHORT の2種類がありえる。
|
||||
fixed (UShort4* p = GetAsUShort4())
|
||||
{
|
||||
var nativeArray = new NativeArray<T>(Count, allocator);
|
||||
UnsafeUtility.MemCpy(nativeArray.GetUnsafePtr(), p, Bytes.Count);
|
||||
return nativeArray;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception($"Stride:{Stride}!= sizeof({typeof(T).Name}:{Marshal.SizeOf(typeof(T))}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user