|
|
@@ -217,7 +217,7 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Single"/> values
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{single}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Float[{Count}]")]
|
|
|
public struct ScalarArray : IList<Single>, IReadOnlyList<Single>
|
|
|
@@ -227,17 +227,15 @@ namespace SharpGLTF.Memory
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="ScalarArray"/> struct.
|
|
|
/// </summary>
|
|
|
- /// <param name="source">The array to wrap.</param>
|
|
|
- /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
- /// <param name="itemsCount">The number of <see cref="Single"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="source">The array range to wrap.</param>
|
|
|
/// <param name="byteStride">
|
|
|
/// The byte stride between elements.
|
|
|
/// If the value is zero, the size of the item is used instead.
|
|
|
/// </param>
|
|
|
/// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
/// <param name="normalized">True if values are normalized.</param>
|
|
|
- public ScalarArray(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public ScalarArray(Byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="ScalarArray"/> struct.
|
|
|
@@ -252,6 +250,21 @@ namespace SharpGLTF.Memory
|
|
|
public ScalarArray(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Initializes a new instance of the <see cref="ScalarArray"/> struct.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="source">The array to wrap.</param>
|
|
|
+ /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="itemsCount">The number of <see cref="Single"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="byteStride">
|
|
|
+ /// The byte stride between elements.
|
|
|
+ /// If the value is zero, the size of the item is used instead.
|
|
|
+ /// </param>
|
|
|
+ /// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
+ /// <param name="normalized">True if values are normalized.</param>
|
|
|
+ public ScalarArray(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="ScalarArray"/> struct.
|
|
|
/// </summary>
|
|
|
@@ -328,7 +341,7 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Vector2"/> values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{Vector2}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Vector2[{Count}]")]
|
|
|
public struct Vector2Array : IList<Vector2>, IReadOnlyList<Vector2>
|
|
|
@@ -339,16 +352,14 @@ namespace SharpGLTF.Memory
|
|
|
/// Initializes a new instance of the <see cref="Vector2Array"/> struct.
|
|
|
/// </summary>
|
|
|
/// <param name="source">The array range to wrap.</param>
|
|
|
- /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
- /// <param name="itemsCount">>The number of <see cref="Vector2"/> items in <paramref name="source"/>.</param>
|
|
|
/// <param name="byteStride">
|
|
|
/// The byte stride between elements.
|
|
|
/// If the value is zero, the size of the item is used instead.
|
|
|
/// </param>
|
|
|
/// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
/// <param name="normalized">True if values are normalized.</param>
|
|
|
- public Vector2Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public Vector2Array(Byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector2Array"/> struct.
|
|
|
@@ -363,6 +374,21 @@ namespace SharpGLTF.Memory
|
|
|
public Vector2Array(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Initializes a new instance of the <see cref="Vector2Array"/> struct.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="source">The array range to wrap.</param>
|
|
|
+ /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="itemsCount">>The number of <see cref="Vector2"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="byteStride">
|
|
|
+ /// The byte stride between elements.
|
|
|
+ /// If the value is zero, the size of the item is used instead.
|
|
|
+ /// </param>
|
|
|
+ /// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
+ /// <param name="normalized">True if values are normalized.</param>
|
|
|
+ public Vector2Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector2Array"/> struct.
|
|
|
/// </summary>
|
|
|
@@ -447,7 +473,7 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Vector3"/> values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{Vector3}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Vector3[{Count}]")]
|
|
|
public struct Vector3Array : IList<Vector3>, IReadOnlyList<Vector3>
|
|
|
@@ -457,17 +483,15 @@ namespace SharpGLTF.Memory
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector3Array"/> struct.
|
|
|
/// </summary>
|
|
|
- /// <param name="source">The array to wrap.</param>
|
|
|
- /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
- /// <param name="itemsCount">The number of <see cref="Vector3"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="source">The array range to wrap.</param>
|
|
|
/// <param name="byteStride">
|
|
|
/// The byte stride between elements.
|
|
|
/// If the value is zero, the size of the item is used instead.
|
|
|
/// </param>
|
|
|
/// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
/// <param name="normalized">True if values are normalized.</param>
|
|
|
- public Vector3Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public Vector3Array(Byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector3Array"/> struct.
|
|
|
@@ -482,6 +506,21 @@ namespace SharpGLTF.Memory
|
|
|
public Vector3Array(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Initializes a new instance of the <see cref="Vector3Array"/> struct.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="source">The array to wrap.</param>
|
|
|
+ /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="itemsCount">The number of <see cref="Vector3"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="byteStride">
|
|
|
+ /// The byte stride between elements.
|
|
|
+ /// If the value is zero, the size of the item is used instead.
|
|
|
+ /// </param>
|
|
|
+ /// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
+ /// <param name="normalized">True if values are normalized.</param>
|
|
|
+ public Vector3Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector3Array"/> struct.
|
|
|
/// </summary>
|
|
|
@@ -567,7 +606,7 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Vector4"/> values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{Vector4}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Vector4[{Count}]")]
|
|
|
public struct Vector4Array : IList<Vector4>, IReadOnlyList<Vector4>
|
|
|
@@ -577,17 +616,15 @@ namespace SharpGLTF.Memory
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector4Array"/> struct.
|
|
|
/// </summary>
|
|
|
- /// <param name="source">The array to wrap.</param>
|
|
|
- /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
- /// <param name="itemsCount">The number of <see cref="Vector3"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="source">The array range to wrap.</param>
|
|
|
/// <param name="byteStride">
|
|
|
/// The byte stride between elements.
|
|
|
/// If the value is zero, the size of the item is used instead.
|
|
|
/// </param>
|
|
|
/// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
/// <param name="normalized">True if values are normalized.</param>
|
|
|
- public Vector4Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public Vector4Array(Byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector4Array"/> struct.
|
|
|
@@ -602,6 +639,21 @@ namespace SharpGLTF.Memory
|
|
|
public Vector4Array(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Initializes a new instance of the <see cref="Vector4Array"/> struct.
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="source">The array to wrap.</param>
|
|
|
+ /// <param name="byteOffset">The zero-based index of the first <see cref="Byte"/> in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="itemsCount">The number of <see cref="Vector3"/> items in <paramref name="source"/>.</param>
|
|
|
+ /// <param name="byteStride">
|
|
|
+ /// The byte stride between elements.
|
|
|
+ /// If the value is zero, the size of the item is used instead.
|
|
|
+ /// </param>
|
|
|
+ /// <param name="encoding">A value of <see cref="ENCODING"/>.</param>
|
|
|
+ /// <param name="normalized">True if values are normalized.</param>
|
|
|
+ public Vector4Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Initializes a new instance of the <see cref="Vector4Array"/> struct.
|
|
|
/// </summary>
|
|
|
@@ -688,19 +740,22 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Quaternion"/> values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{Quaternion}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Quaternion[{Count}]")]
|
|
|
public struct QuaternionArray : IList<Quaternion>, IReadOnlyList<Quaternion>
|
|
|
{
|
|
|
#region constructors
|
|
|
|
|
|
- public QuaternionArray(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public QuaternionArray(Byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
public QuaternionArray(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ public QuaternionArray(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
public QuaternionArray(BYTES source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding, Boolean normalized)
|
|
|
{
|
|
|
_Accessor = new FloatingAccessor(source, byteOffset, itemsCount, byteStride, 4, encoding, normalized);
|
|
|
@@ -775,19 +830,22 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="Matrix4x4"/> values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an <see cref="IList{Matrix4x4}"/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Matrix4x4[{Count}]")]
|
|
|
public struct Matrix4x4Array : IList<Matrix4x4>, IReadOnlyList<Matrix4x4>
|
|
|
{
|
|
|
#region constructors
|
|
|
|
|
|
- public Matrix4x4Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
- : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+ public Matrix4x4Array(byte[] source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
public Matrix4x4Array(BYTES source, int byteStride = 0, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
: this(source, 0, int.MaxValue, byteStride, encoding, normalized) { }
|
|
|
|
|
|
+ public Matrix4x4Array(Byte[] source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding = ENCODING.FLOAT, Boolean normalized = false)
|
|
|
+ : this(new BYTES(source), byteOffset, itemsCount, byteStride, encoding, normalized) { }
|
|
|
+
|
|
|
public Matrix4x4Array(BYTES source, int byteOffset, int itemsCount, int byteStride, ENCODING encoding, Boolean normalized)
|
|
|
{
|
|
|
_Accessor = new FloatingAccessor(source, byteOffset, itemsCount, byteStride, 16, encoding, normalized);
|
|
|
@@ -880,7 +938,7 @@ namespace SharpGLTF.Memory
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
|
- /// Wraps an encoded <see cref="BYTES"/> and exposes it as an array of <see cref="float"/> array values.
|
|
|
+ /// Wraps an encoded <see cref="BYTES"/> and exposes it as an IList{Single[]}/>.
|
|
|
/// </summary>
|
|
|
[System.Diagnostics.DebuggerDisplay("Float[][{Count}]")]
|
|
|
public struct MultiArray : IList<Single[]>, IReadOnlyList<Single[]>
|