Documentation
¶
Overview ¶
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.
Index ¶
- type Advanced
- type Any
- type Extension
- type GLTFAccessorType
- type GLTFComponentType
- type ID
- type Instance
- func (self Instance) AccessorType() GLTFAccessorType
- func (self Instance) AsGLTFAccessor() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) BufferView() int
- func (self Instance) ByteOffset() int
- func (self Instance) ComponentType() GLTFComponentType
- func (self Instance) Count() int
- func (self Instance) ID() ID
- func (self Instance) Max() []float64
- func (self Instance) Min() []float64
- func (self Instance) Normalized() bool
- func (self Instance) SetAccessorType(value GLTFAccessorType)
- func (self Instance) SetBufferView(value int)
- func (self Instance) SetByteOffset(value int)
- func (self Instance) SetComponentType(value GLTFComponentType)
- func (self Instance) SetCount(value int)
- func (self Instance) SetMax(value []float64)
- func (self Instance) SetMin(value []float64)
- func (self Instance) SetNormalized(value bool)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSparseCount(value int)
- func (self Instance) SetSparseIndicesBufferView(value int)
- func (self Instance) SetSparseIndicesByteOffset(value int)
- func (self Instance) SetSparseIndicesComponentType(value GLTFComponentType)
- func (self Instance) SetSparseValuesBufferView(value int)
- func (self Instance) SetSparseValuesByteOffset(value int)
- func (self Instance) SetType(value int)
- func (self Instance) SparseCount() int
- func (self Instance) SparseIndicesBufferView() int
- func (self Instance) SparseIndicesByteOffset() int
- func (self Instance) SparseIndicesComponentType() GLTFComponentType
- func (self Instance) SparseValuesBufferView() int
- func (self Instance) SparseValuesByteOffset() int
- func (self Instance) Type() int
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsGLTFAccessor ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type GLTFAccessorType ¶
type GLTFAccessorType int //gd:GLTFAccessor.GLTFAccessorType
const ( // 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. TypeScalar GLTFAccessorType = 0 // Accessor type "VEC2". For the glTF object model, this maps to "float2", represented in the glTF JSON as an array of two floats. TypeVec2 GLTFAccessorType = 1 // Accessor type "VEC3". For the glTF object model, this maps to "float3", represented in the glTF JSON as an array of three floats. TypeVec3 GLTFAccessorType = 2 // Accessor type "VEC4". For the glTF object model, this maps to "float4", represented in the glTF JSON as an array of four floats. TypeVec4 GLTFAccessorType = 3 // Accessor type "MAT2". For the glTF object model, this maps to "float2x2", represented in the glTF JSON as an array of four floats. TypeMat2 GLTFAccessorType = 4 // Accessor type "MAT3". For the glTF object model, this maps to "float3x3", represented in the glTF JSON as an array of nine floats. TypeMat3 GLTFAccessorType = 5 // Accessor type "MAT4". For the glTF object model, this maps to "float4x4", represented in the glTF JSON as an array of sixteen floats. TypeMat4 GLTFAccessorType = 6 )
type GLTFComponentType ¶
type GLTFComponentType int //gd:GLTFAccessor.GLTFComponentType
const ( // Component type "NONE". This is not a valid component type, and is used to indicate that the component type is not set. ComponentTypeNone GLTFComponentType = 0 // 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. ComponentTypeSignedByte GLTFComponentType = 5120 // 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. ComponentTypeUnsignedByte GLTFComponentType = 5121 // 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. ComponentTypeSignedShort GLTFComponentType = 5122 // 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. ComponentTypeUnsignedShort GLTFComponentType = 5123 // 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. ComponentTypeSignedInt GLTFComponentType = 5124 // 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. ComponentTypeUnsignedInt GLTFComponentType = 5125 // 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. ComponentTypeSingleFloat GLTFComponentType = 5126 // 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. ComponentTypeDoubleFloat GLTFComponentType = 5130 // 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. ComponentTypeHalfFloat GLTFComponentType = 5131 // 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. ComponentTypeSignedLong GLTFComponentType = 5134 // 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. ComponentTypeUnsignedLong GLTFComponentType = 5135 )
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.GLTFAccessor
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AccessorType ¶
func (self Instance) AccessorType() GLTFAccessorType
The glTF accessor type, as an enum.
func (Instance) AsGLTFAccessor ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) BufferView ¶
The index of the buffer view this accessor is referencing. If -1, this accessor is not referencing any buffer view.
func (Instance) ByteOffset ¶
The offset relative to the start of the buffer view in bytes.
func (Instance) ComponentType ¶
func (self Instance) ComponentType() GLTFComponentType
The glTF component type as an enum. See 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.
func (Instance) Normalized ¶
Specifies whether integer data values are normalized before usage.
func (Instance) SetAccessorType ¶
func (self Instance) SetAccessorType(value GLTFAccessorType)
SetAccessorType sets the property returned by [GetAccessorType].
func (Instance) SetBufferView ¶
SetBufferView sets the property returned by [GetBufferView].
func (Instance) SetByteOffset ¶
SetByteOffset sets the property returned by [GetByteOffset].
func (Instance) SetComponentType ¶
func (self Instance) SetComponentType(value GLTFComponentType)
SetComponentType sets the property returned by [GetComponentType].
func (Instance) SetNormalized ¶
SetNormalized sets the property returned by [GetNormalized].
func (Instance) SetSparseCount ¶
SetSparseCount sets the property returned by [GetSparseCount].
func (Instance) SetSparseIndicesBufferView ¶
SetSparseIndicesBufferView sets the property returned by [GetSparseIndicesBufferView].
func (Instance) SetSparseIndicesByteOffset ¶
SetSparseIndicesByteOffset sets the property returned by [GetSparseIndicesByteOffset].
func (Instance) SetSparseIndicesComponentType ¶
func (self Instance) SetSparseIndicesComponentType(value GLTFComponentType)
SetSparseIndicesComponentType sets the property returned by [GetSparseIndicesComponentType].
func (Instance) SetSparseValuesBufferView ¶
SetSparseValuesBufferView sets the property returned by [GetSparseValuesBufferView].
func (Instance) SetSparseValuesByteOffset ¶
SetSparseValuesByteOffset sets the property returned by [GetSparseValuesByteOffset].
func (Instance) SparseCount ¶
Number of deviating accessor values stored in the sparse array.
func (Instance) SparseIndicesBufferView ¶
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.
func (Instance) SparseIndicesByteOffset ¶
The offset relative to the start of the buffer view in bytes.
func (Instance) SparseIndicesComponentType ¶
func (self Instance) SparseIndicesComponentType() GLTFComponentType
The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT".
func (Instance) SparseValuesBufferView ¶
The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.
func (Instance) SparseValuesByteOffset ¶
The offset relative to the start of the bufferView in bytes.