reckfellENGINE

GltfAccessor

Represents a glTF accessor.

On this page
class GltfAccessorReckfellSharpInherits Resource

Represents a glTF accessor.

GLTFAccessor is a data structure representing a glTF accessor that would be found in the "accessors" array. A buffer is a blob of binary data. A buffer view is a slice of a buffer. An accessor is a typed interpretation of the data in a buffer view. Most custom data stored in glTF does not need accessors, only buffer views (see GltfBufferView). Accessors 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

GltfAccessorConstructor
# GltfAccessor
C#
public GltfAccessor();

Properties15

AccessorTypeProperty
# AccessorType
C#
public GltfAccessor.GltfAccessorType AccessorType { get; set; }

The glTF accessor type, as an enum.

BufferViewProperty
# BufferView
C#
public int BufferView { get; set; }

The index of the buffer view this accessor is referencing. If -1, this accessor is not referencing any buffer view.

ByteOffsetProperty
# ByteOffset
C#
public long ByteOffset { get; set; }

The offset relative to the start of the buffer view in bytes.

ComponentTypeProperty
# ComponentType
C#
public GltfAccessor.GltfComponentType ComponentType { get; set; }

The glTF component type as an enum. See GltfAccessor.GltfComponentType for possible values. Within the core glTF specification, a value of 5125 or "UNSIGNED_INT" must not be used for any accessor that is not referenced by mesh.primitive.indices.

CountProperty
# Count
C#
public long Count { get; set; }

The number of elements referenced by this accessor.

MaxProperty
# Max
C#
public double[] Max { get; set; }

Maximum value of each component in this accessor.

MinProperty
# Min
C#
public double[] Min { get; set; }

Minimum value of each component in this accessor.

NormalizedProperty
# Normalized
C#
public bool Normalized { get; set; }

Specifies whether integer data values are normalized before usage.

SparseCountProperty
# SparseCount
C#
public long SparseCount { get; set; }

Number of deviating accessor values stored in the sparse array.

SparseIndicesBufferViewProperty
# SparseIndicesBufferView
C#
public int SparseIndicesBufferView { get; set; }

The index of the buffer view with sparse indices. The referenced buffer view MUST NOT have its target or byteStride properties defined. The buffer view and the optional byteOffset MUST be aligned to the componentType byte length.

SparseIndicesByteOffsetProperty
# SparseIndicesByteOffset
C#
public long SparseIndicesByteOffset { get; set; }

The offset relative to the start of the buffer view in bytes.

SparseIndicesComponentTypeProperty
# SparseIndicesComponentType
C#
public GltfAccessor.GltfComponentType SparseIndicesComponentType { get; set; }

The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT".

SparseValuesBufferViewProperty
# SparseValuesBufferView
C#
public int SparseValuesBufferView { get; set; }

The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.

SparseValuesByteOffsetProperty
# SparseValuesByteOffset
C#
public long SparseValuesByteOffset { get; set; }

The offset relative to the start of the bufferView in bytes.

TypeProperty · Deprecated
# Type
C#
public int Type { get; set; }

The glTF accessor type, as an [int]. Possible values are 0 for "SCALAR", 1 for "VEC2", 2 for "VEC3", 3 for "VEC4", 4 for "MAT2", 5 for "MAT3", and 6 for "MAT4".

Methods36

FromDictionaryGltfAccessor
# FromDictionary
C#
public static GltfAccessor FromDictionary(Reckfell.Collections.Dictionary dictionary);

Creates a new GLTFAccessor instance by parsing the given Reckfell.Collections.Dictionary.

Parameters
NameTypeDefault
dictionaryReckfell.Collections.Dictionary—
Returns GltfAccessor
GetAccessorTypeGltfAccessor.GltfAccessorType
# GetAccessorType
C#
public GltfAccessor.GltfAccessorType GetAccessorType();
Returns GltfAccessor.GltfAccessorType
GetBufferViewint
# GetBufferView
C#
public int GetBufferView();
Returns int
GetByteOffsetlong
# GetByteOffset
C#
public long GetByteOffset();
Returns long
GetComponentTypeGltfAccessor.GltfComponentType
# GetComponentType
C#
public GltfAccessor.GltfComponentType GetComponentType();
Returns GltfAccessor.GltfComponentType
GetCountlong
# GetCount
C#
public long GetCount();
Returns long
GetMaxdouble[]
# GetMax
C#
public double[] GetMax();
Returns double[]
GetMindouble[]
# GetMin
C#
public double[] GetMin();
Returns double[]
GetNormalizedbool
# GetNormalized
C#
public bool GetNormalized();
Returns bool
GetSparseCountlong
# GetSparseCount
C#
public long GetSparseCount();
Returns long
GetSparseIndicesBufferViewint
# GetSparseIndicesBufferView
C#
public int GetSparseIndicesBufferView();
Returns int
GetSparseIndicesByteOffsetlong
# GetSparseIndicesByteOffset
C#
public long GetSparseIndicesByteOffset();
Returns long
GetSparseIndicesComponentTypeGltfAccessor.GltfComponentType
# GetSparseIndicesComponentType
C#
public GltfAccessor.GltfComponentType GetSparseIndicesComponentType();
Returns GltfAccessor.GltfComponentType
GetSparseValuesBufferViewint
# GetSparseValuesBufferView
C#
public int GetSparseValuesBufferView();
Returns int
GetSparseValuesByteOffsetlong
# GetSparseValuesByteOffset
C#
public long GetSparseValuesByteOffset();
Returns long
GetTypeint
# GetType
C#
public int GetType();
Returns int
SetAccessorTypevoid
# SetAccessorType
C#
public void SetAccessorType(GltfAccessor.GltfAccessorType accessorType);
Parameters
NameTypeDefault
accessorTypeGltfAccessor.GltfAccessorType—
SetBufferViewvoid
# SetBufferView
C#
public void SetBufferView(int bufferView);
Parameters
NameTypeDefault
bufferViewint—
SetByteOffsetvoid
# SetByteOffset
C#
public void SetByteOffset(long byteOffset);
Parameters
NameTypeDefault
byteOffsetlong—
SetComponentType2 overloads
# SetComponentType · 1/2
C#
public void SetComponentType(GltfAccessor.GltfComponentType componentType);
Parameters
NameTypeDefault
componentTypeGltfAccessor.GltfComponentType—
# SetComponentType · 2/2
C#
public void SetComponentType(int componentType);
Parameters
NameTypeDefault
componentTypeint—
SetCountvoid
# SetCount
C#
public void SetCount(long count);
Parameters
NameTypeDefault
countlong—
SetMax2 overloads
# SetMax · 1/2
C#
public void SetMax(double[] max);
Parameters
NameTypeDefault
maxdouble[]—
# SetMax · 2/2
C#
public void SetMax(ReadOnlySpan<double> max);
Parameters
NameTypeDefault
maxReadOnlySpan<double>—
SetMin2 overloads
# SetMin · 1/2
C#
public void SetMin(double[] min);
Parameters
NameTypeDefault
mindouble[]—
# SetMin · 2/2
C#
public void SetMin(ReadOnlySpan<double> min);
Parameters
NameTypeDefault
minReadOnlySpan<double>—
SetNormalizedvoid
# SetNormalized
C#
public void SetNormalized(bool normalized);
Parameters
NameTypeDefault
normalizedbool—
SetSparseCountvoid
# SetSparseCount
C#
public void SetSparseCount(long sparseCount);
Parameters
NameTypeDefault
sparseCountlong—
SetSparseIndicesBufferViewvoid
# SetSparseIndicesBufferView
C#
public void SetSparseIndicesBufferView(int sparseIndicesBufferView);
Parameters
NameTypeDefault
sparseIndicesBufferViewint—
SetSparseIndicesByteOffsetvoid
# SetSparseIndicesByteOffset
C#
public void SetSparseIndicesByteOffset(long sparseIndicesByteOffset);
Parameters
NameTypeDefault
sparseIndicesByteOffsetlong—
SetSparseIndicesComponentType2 overloads
# SetSparseIndicesComponentType · 1/2
C#
public void SetSparseIndicesComponentType(GltfAccessor.GltfComponentType sparseIndicesComponentType);
Parameters
NameTypeDefault
sparseIndicesComponentTypeGltfAccessor.GltfComponentType—
# SetSparseIndicesComponentType · 2/2
C#
public void SetSparseIndicesComponentType(int sparseIndicesComponentType);
Parameters
NameTypeDefault
sparseIndicesComponentTypeint—
SetSparseValuesBufferViewvoid
# SetSparseValuesBufferView
C#
public void SetSparseValuesBufferView(int sparseValuesBufferView);
Parameters
NameTypeDefault
sparseValuesBufferViewint—
SetSparseValuesByteOffsetvoid
# SetSparseValuesByteOffset
C#
public void SetSparseValuesByteOffset(long sparseValuesByteOffset);
Parameters
NameTypeDefault
sparseValuesByteOffsetlong—
SetTypevoid
# SetType
C#
public void SetType(int type);
Parameters
NameTypeDefault
typeint—
ToDictionaryReckfell.Collections.Dictionary
# ToDictionary
C#
public Reckfell.Collections.Dictionary ToDictionary();

Serializes this GLTFAccessor instance into a Reckfell.Collections.Dictionary.

Returns Reckfell.Collections.Dictionary

GltfAccessor.GltfAccessorType

ValueDescription
Mat2 = 4

Accessor type "MAT2". For the glTF object model, this maps to "float2x2", represented in the glTF JSON as an array of four floats.

Mat3 = 5

Accessor type "MAT3". For the glTF object model, this maps to "float3x3", represented in the glTF JSON as an array of nine floats.

Mat4 = 6

Accessor type "MAT4". For the glTF object model, this maps to "float4x4", represented in the glTF JSON as an array of sixteen floats.

Scalar = 0

Accessor type "SCALAR". For the glTF object model, this can be used to map to a single float, int, or bool value, or a float array.

Vec2 = 1

Accessor type "VEC2". For the glTF object model, this maps to "float2", represented in the glTF JSON as an array of two floats.

Vec3 = 2

Accessor type "VEC3". For the glTF object model, this maps to "float3", represented in the glTF JSON as an array of three floats.

Vec4 = 3

Accessor type "VEC4". For the glTF object model, this maps to "float4", represented in the glTF JSON as an array of four floats.

GltfAccessor.GltfComponentType

ValueDescription
DoubleFloat = 5130

Component type "DOUBLE". The value is 0x140A which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit floating-point numbers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including KHR_interactivity.

HalfFloat = 5131

Component type "HALF_FLOAT". The value is 0x140B which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit floating-point numbers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including KHR_interactivity.

None = 0

Component type "NONE". This is not a valid component type, and is used to indicate that the component type is not set.

SignedByte = 5120

Component type "BYTE". The value is 0x1400 which comes from OpenGL. This indicates data is stored in 1-byte or 8-bit signed integers. This is a core part of the glTF specification.

SignedInt = 5124

Component type "INT". The value is 0x1404 which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit signed integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including KHR_interactivity.

SignedLong = 5134

Component type "LONG". The value is 0x140E which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit signed integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including KHR_interactivity.

SignedShort = 5122

Component type "SHORT". The value is 0x1402 which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit signed integers. This is a core part of the glTF specification.

SingleFloat = 5126

Component type "FLOAT". The value is 0x1406 which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit floating-point numbers. This is a core part of the glTF specification.

UnsignedByte = 5121

Component type "UNSIGNED_BYTE". The value is 0x1401 which comes from OpenGL. This indicates data is stored in 1-byte or 8-bit unsigned integers. This is a core part of the glTF specification.

UnsignedInt = 5125

Component type "UNSIGNED_INT". The value is 0x1405 which comes from OpenGL. This indicates data is stored in 4-byte or 32-bit unsigned integers. This is a core part of the glTF specification.

UnsignedLong = 5135

Component type "UNSIGNED_LONG". The value is 0x140F which comes from OpenGL. This indicates data is stored in 8-byte or 64-bit unsigned integers. This is NOT a core part of the glTF specification, and may not be supported by all glTF importers. May be used by some extensions including KHR_interactivity.

UnsignedShort = 5123

Component type "UNSIGNED_SHORT". The value is 0x1403 which comes from OpenGL. This indicates data is stored in 2-byte or 16-bit unsigned integers. This is a core part of the glTF specification.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.