mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-09 12:29:23 -05:00
primitive.indices の型を ushort に対応させる
This commit is contained in:
@@ -72,6 +72,10 @@ namespace UniGLTF
|
||||
{
|
||||
return cv.ComponentType;
|
||||
}
|
||||
else if (typeof(T) == typeof(ushort))
|
||||
{
|
||||
return glComponentType.UNSIGNED_SHORT;
|
||||
}
|
||||
else if (typeof(T) == typeof(uint))
|
||||
{
|
||||
return glComponentType.UNSIGNED_INT;
|
||||
@@ -119,10 +123,10 @@ namespace UniGLTF
|
||||
}
|
||||
}
|
||||
|
||||
public static int ExtendBufferAndGetAccessorIndex<T>(this glTF gltf, int bufferIndex, T[] array,
|
||||
public static int ExtendBufferAndGetAccessorIndex<T>(this glTF gltf, int bufferIndex, IReadOnlyList<T> list,
|
||||
glBufferTarget target = glBufferTarget.NONE) where T : struct
|
||||
{
|
||||
return gltf.ExtendBufferAndGetAccessorIndex(bufferIndex, new ArraySegment<T>(array), target);
|
||||
return gltf.ExtendBufferAndGetAccessorIndex(bufferIndex, new ArraySegment<T>(list.ToArray()), target);
|
||||
}
|
||||
|
||||
public static int ExtendBufferAndGetAccessorIndex<T>(this glTF gltf, int bufferIndex,
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace UniGLTF
|
||||
indices.Add((uint)i0);
|
||||
}
|
||||
|
||||
var indicesAccessorIndex = gltf.ExtendBufferAndGetAccessorIndex(bufferIndex, indices.ToArray(), glBufferTarget.ELEMENT_ARRAY_BUFFER);
|
||||
var indicesAccessorIndex = gltf.ExtendBufferAndGetAccessorIndex(bufferIndex, indices, glBufferTarget.ELEMENT_ARRAY_BUFFER);
|
||||
if (indicesAccessorIndex < 0)
|
||||
{
|
||||
// https://github.com/vrm-c/UniVRM/issues/664
|
||||
|
||||
Reference in New Issue
Block a user