GLTFAccessor
Represents a GLTF accessor.
GLTFAccessor.swift:20class GLTFAccessor
GLTFAccessor is a data structure representing GLTF a 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.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var accessorType: Int32
The GLTF accessor type as an enum. 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”.
var bufferView: Int32
The index of the buffer view this accessor is referencing. If
-1
, this accessor is not referencing any buffer view.var byteOffset: Int32
The offset relative to the start of the buffer view in bytes.
var componentType: Int32
The GLTF component type as an enum. Possible values are 5120 for “BYTE”, 5121 for “UNSIGNED_BYTE”, 5122 for “SHORT”, 5123 for “UNSIGNED_SHORT”, 5125 for “UNSIGNED_INT”, and 5126 for “FLOAT”. A value of 5125 or “UNSIGNED_INT” must not be used for any accessor that is not referenced by mesh.primitive.indices.
var count: Int32
The number of elements referenced by this accessor.
var max: PackedFloat64Array
Maximum value of each component in this accessor.
var min: PackedFloat64Array
Minimum value of each component in this accessor.
var normalized: Bool
Specifies whether integer data values are normalized before usage.
var sparseCount: Int32
Number of deviating accessor values stored in the sparse array.
var sparseIndicesBufferView: Int32
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.
var sparseIndicesByteOffset: Int32
The offset relative to the start of the buffer view in bytes.
var sparseIndicesComponentType: Int32
The indices component data type as an enum. Possible values are 5121 for “UNSIGNED_BYTE”, 5123 for “UNSIGNED_SHORT”, and 5125 for “UNSIGNED_INT”.
var sparseValuesBufferView: Int32
The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.
var sparseValuesByteOffset: Int32
The offset relative to the start of the bufferView in bytes.
var type: Int32
The GLTF accessor type as an enum. Use
accessorType
instead.