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 graphics.gd/classdb/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
func (Instance) AsGLTFAccessor ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) BufferView ¶
func (Instance) ByteOffset ¶
func (Instance) ComponentType ¶
func (self Instance) ComponentType() GLTFComponentType
func (Instance) Normalized ¶
func (Instance) SetAccessorType ¶
func (self Instance) SetAccessorType(value GLTFAccessorType)
func (Instance) SetBufferView ¶
func (Instance) SetByteOffset ¶
func (Instance) SetComponentType ¶
func (self Instance) SetComponentType(value GLTFComponentType)
func (Instance) SetNormalized ¶
func (Instance) SetSparseCount ¶
func (Instance) SetSparseIndicesBufferView ¶
func (Instance) SetSparseIndicesByteOffset ¶
func (Instance) SetSparseIndicesComponentType ¶
func (self Instance) SetSparseIndicesComponentType(value GLTFComponentType)
func (Instance) SetSparseValuesBufferView ¶
func (Instance) SetSparseValuesByteOffset ¶
func (Instance) SparseCount ¶
func (Instance) SparseIndicesBufferView ¶
func (Instance) SparseIndicesByteOffset ¶
func (Instance) SparseIndicesComponentType ¶
func (self Instance) SparseIndicesComponentType() GLTFComponentType