Class AccessorBase
An accessor defines a method for retrieving data as typed arrays from within a buffer view. See . accessor in the glTF 2.0 specification.
Inherited Members
Namespace: GLTFast.Schema
Assembly: solution.dll
Syntax
[Serializable]
public abstract class AccessorBase : NamedObject
Fields
Name | Description |
---|---|
bufferView | The index of the bufferView. If this is undefined, look in the sparse object for the index and value buffer views. |
byteOffset | The offset relative to the start of the bufferView in bytes. This must be a multiple of the size of the component datatype. |
componentType | The datatype of components in the attribute.
All valid values correspond to WebGL enums.
The corresponding typed arrays are: |
count | The number of attributes referenced by this accessor, not to be confused with the number of bytes or number of components. |
max | Maximum value of each component in this attribute. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16. When
|
min | Minimum value of each component in this attribute. Both min and max arrays have the same length. The length is determined by the value of the type property; it can be 1, 2, 3, 4, 9, or 16. When
|
normalized | Specifies whether integer data values should be normalized
( |
type | Specifies if the attribute is a scalar, vector, or matrix, and the number of elements in the vector or matrix. |
Properties
Name | Description |
---|---|
ByteSize | Overall, byte size. Ignores interleaved or sparse accessors |
ElementByteSize | Byte size of one element |
IsSparse | True if the accessor is sparse |
Sparse | Sparse storage of attributes that deviate from their initialization value. |
Methods
Name | Description |
---|---|
GetAccessorAttributeType(int) | Get one-dimensional glTF attribute type by number of components per elements. Note that this does not support matrix types. |
GetAccessorAttributeTypeLength(GltfAccessorAttributeType) | Get number of components of glTF attribute type. |
GetAttributeType() | GltfAccessorAttributeType typed/cached getter from the type string. |
GetComponentType(VertexAttributeFormat) | Converts Unity vertex attribute format to glTF component type. |
GetComponentTypeSize(GltfComponentType) | Provides size of components by type |
SetAttributeType(GltfAccessorAttributeType) | GltfAccessorAttributeType typed setter for the type string. |
TryGetBounds() | For 3D positional data, returns accessor's bounding box. Applies coordinate system transform (glTF to Unity) |