Up to date
This page is up to date for Godot 4.3.
If you still find outdated information, please open an issue.
GLTFAccessor
继承: Resource < RefCounted < Object
代表 GLTF 访问器。
描述
GLTFAccessor 是一个表示 GLTF 的数据结构,一个可以在 "accessors" 数组中找到的 accessor。缓冲区是二进制数据的 blob。缓冲区视图是缓冲区的一个切片。访问器是缓冲区视图中数据的类型化解释。
大多数存储在 GLTF 中的自定义数据不需要访问器,只需要缓冲区视图(请参阅 GLTFBufferView)。访问器适用于更高级的用例,例如为 GPU 编码的交错网格数据。
教程
属性
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
枚举
enum GLTFAccessorType: 🔗
GLTFAccessorType TYPE_SCALAR = 0
“SCALAR”访问器类型。在 glTF 对象模型中可映射为单个 float、int、bool 值或单个 float 数组。
GLTFAccessorType TYPE_VEC2 = 1
“VEC2”访问器类型。在 glTF 对象模型中可映射为“float2”,在 glTF JSON 中表示为包含两个 float 的数组。
GLTFAccessorType TYPE_VEC3 = 2
“VEC3”访问器类型。在 glTF 对象模型中可映射为“float3”,在 glTF JSON 中表示为包含三个 float 的数组。
GLTFAccessorType TYPE_VEC4 = 3
“VEC4”访问器类型。在 glTF 对象模型中可映射为“float4”,在 glTF JSON 中表示为包含四个 float 的数组。
GLTFAccessorType TYPE_MAT2 = 4
“MAT2”访问器类型。在 glTF 对象模型中可映射为“float2x2”,在 glTF JSON 中表示为包含四个 float 的数组。
GLTFAccessorType TYPE_MAT3 = 5
“MAT3”访问器类型。在 glTF 对象模型中可映射为“float3x3”,在 glTF JSON 中表示为包含九个 float 的数组。
GLTFAccessorType TYPE_MAT4 = 6
“MAT4”访问器类型。在 glTF 对象模型中可映射为“float4x4”,在 glTF JSON 中表示为包含十六个 float 的数组。
属性说明
GLTFAccessorType accessor_type = 0 🔗
void set_accessor_type(value: GLTFAccessorType)
GLTFAccessorType get_accessor_type()
GLTF 访问器类型枚举。取值为 0 表示“SCALAR”、1 表示“VEC2”、2 表示“VEC3”、3 表示“VEC4”、4 表示“MAT2”、5 表示“MAT3”、6 表示“MAT4”。
该访问器正在引用的缓冲区视图的索引。如果为 -1,则该访问器未引用任何缓冲区视图。
相对于缓冲视图起点的偏移量,单位为字节。
GLTF 组件类型枚举。取值为 5120 表示“BYTE”、5121 表示“UNSIGNED_BYTE”、5122 表示“SHORT”、5123 表示“UNSIGNED_SHORT”、5125 表示“UNSIGNED_INT”、5126 表示“FLOAT”。不是通过mesh.primitive.indices 引用的访问器不能使用 5125 或“UNSIGNED_INT”。
该访问器引用的元素数量。
PackedFloat64Array max = PackedFloat64Array() 🔗
void set_max(value: PackedFloat64Array)
PackedFloat64Array get_max()
该访问器中每个组件的最大值。
PackedFloat64Array min = PackedFloat64Array() 🔗
void set_min(value: PackedFloat64Array)
PackedFloat64Array get_min()
该访问器中每个组件的最小值。
指定整数数据值在使用前是否进行了归一化。
存储在稀疏数组中的偏差访问器值的数量。
int sparse_indices_buffer_view = 0 🔗
具有稀疏索引的缓冲视图的索引。引用的缓冲视图不得定义其 target 或 byteStride 属性。缓冲视图和可选的 byteOffset 必须与 componentType 字节长度对齐。
int sparse_indices_byte_offset = 0 🔗
相对于缓冲视图起点的偏移量,单位为字节。
int sparse_indices_component_type = 0 🔗
索引组件数据类型枚举。取值 5121 为“UNSIGNED_BYTE”、5123 为“UNSIGNED_SHORT”、5125 为“UNSIGNED_INT”。
int sparse_values_buffer_view = 0 🔗
具有稀疏值的 bufferView 的索引。引用的缓冲视图不得定义其 target 或 byteStride 属性。
int sparse_values_byte_offset = 0 🔗
相对于 bufferView 起始位置的偏移量,单位为字节。
已弃用: Use accessor_type instead.
GLTF 访问器类型枚举。请改用 accessor_type。