GltfBufferView
Represents a glTF buffer view.
Represents a glTF buffer view.
GLTFBufferView is a data structure representing a glTF bufferView that would be found in the "bufferViews" array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer.
Most custom uses of buffers only need to use the GltfBufferView.Buffer, GltfBufferView.ByteLength, and GltfBufferView.ByteOffset. The GltfBufferView.ByteStride and GltfBufferView.Indices properties are for more advanced use cases such as interleaved mesh data encoded for the GPU.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
GltfBufferViewConstructor
public GltfBufferView();Properties6
BufferProperty
public int Buffer { get; set; }The index of the buffer this buffer view is referencing. If -1, this buffer view is not referencing any buffer.
ByteLengthProperty
public long ByteLength { get; set; }The length, in bytes, of this buffer view. If 0, this buffer view is empty.
ByteOffsetProperty
public long ByteOffset { get; set; }The offset, in bytes, from the start of the buffer to the start of this buffer view.
ByteStrideProperty
public long ByteStride { get; set; }The stride, in bytes, between interleaved data. If -1, this buffer view is not interleaved.
IndicesProperty
public bool Indices { get; set; }true if the GLTFBufferView's OpenGL GPU buffer type is an ELEMENT_ARRAY_BUFFER used for vertex indices (integer constant 34963). false if the buffer type is any other value. See Buffers, BufferViews, and Accessors for possible values. This property is set on import and used on export.
VertexAttributesProperty
public bool VertexAttributes { get; set; }true if the GLTFBufferView's OpenGL GPU buffer type is an ARRAY_BUFFER used for vertex attributes (integer constant 34962). false if the buffer type is any other value. See Buffers, BufferViews, and Accessors for possible values. This property is set on import and used on export.
Methods15
FromDictionaryGltfBufferView
public static GltfBufferView FromDictionary(Reckfell.Collections.Dictionary dictionary);Creates a new GLTFBufferView instance by parsing the given Reckfell.Collections.Dictionary.
| Name | Type | Default |
|---|---|---|
dictionary | Reckfell.Collections.Dictionary | — |
GltfBufferViewGetBufferint
public int GetBuffer();intGetByteLengthlong
public long GetByteLength();longGetByteOffsetlong
public long GetByteOffset();longGetByteStridelong
public long GetByteStride();longGetIndicesbool
public bool GetIndices();boolGetVertexAttributesbool
public bool GetVertexAttributes();boolLoadBufferViewDatabyte[]
public byte[] LoadBufferViewData(GltfState state);Loads the buffer view data from the buffer referenced by this buffer view in the given GltfState. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a byte[].
| Name | Type | Default |
|---|---|---|
state | GltfState | — |
byte[]SetBuffervoid
public void SetBuffer(int buffer);| Name | Type | Default |
|---|---|---|
buffer | int | — |
SetByteLengthvoid
public void SetByteLength(long byteLength);| Name | Type | Default |
|---|---|---|
byteLength | long | — |
SetByteOffsetvoid
public void SetByteOffset(long byteOffset);| Name | Type | Default |
|---|---|---|
byteOffset | long | — |
SetByteStridevoid
public void SetByteStride(long byteStride);| Name | Type | Default |
|---|---|---|
byteStride | long | — |
SetIndicesvoid
public void SetIndices(bool indices);| Name | Type | Default |
|---|---|---|
indices | bool | — |
SetVertexAttributesvoid
public void SetVertexAttributes(bool isAttributes);| Name | Type | Default |
|---|---|---|
isAttributes | bool | — |
ToDictionaryReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary ToDictionary();Serializes this GLTFBufferView instance into a Reckfell.Collections.Dictionary.
Reckfell.Collections.Dictionary