Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

GLTFAccessor

继承: Resource < RefCounted < Object

代表 GLTF 访问器。

描述

GLTFAccessor 是一个表示 GLTF 的数据结构,一个可以在 "accessors" 数组中找到的 accessor。缓冲区是二进制数据的 blob。缓冲区视图是缓冲区的一个切片。访问器是缓冲区视图中数据的类型化解释。

大多数存储在 GLTF 中的自定义数据不需要访问器,只需要缓冲区视图(请参阅 GLTFBufferView)。访问器适用于更高级的用例,例如为 GPU 编码的交错网格数据。

教程

属性

int

accessor_type

0

int

buffer_view

-1

int

byte_offset

0

int

component_type

0

int

count

0

PackedFloat64Array

max

PackedFloat64Array()

PackedFloat64Array

min

PackedFloat64Array()

bool

normalized

false

int

sparse_count

0

int

sparse_indices_buffer_view

0

int

sparse_indices_byte_offset

0

int

sparse_indices_component_type

0

int

sparse_values_buffer_view

0

int

sparse_values_byte_offset

0

int

type

0


属性说明

int accessor_type = 0 🔗

  • void set_accessor_type(value: int)

  • int get_accessor_type()

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".


int buffer_view = -1 🔗

  • void set_buffer_view(value: int)

  • int get_buffer_view()

该访问器正在引用的缓冲区视图的索引。如果为 -1,则该访问器未引用任何缓冲区视图。


int byte_offset = 0 🔗

  • void set_byte_offset(value: int)

  • int get_byte_offset()

The offset relative to the start of the buffer view in bytes.


int component_type = 0 🔗

  • void set_component_type(value: int)

  • int get_component_type()

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.


int count = 0 🔗

  • void set_count(value: int)

  • int get_count()

The number of elements referenced by this accessor.


PackedFloat64Array max = PackedFloat64Array() 🔗

Maximum value of each component in this accessor.


PackedFloat64Array min = PackedFloat64Array() 🔗

Minimum value of each component in this accessor.


bool normalized = false 🔗

  • void set_normalized(value: bool)

  • bool get_normalized()

Specifies whether integer data values are normalized before usage.


int sparse_count = 0 🔗

  • void set_sparse_count(value: int)

  • int get_sparse_count()

Number of deviating accessor values stored in the sparse array.


int sparse_indices_buffer_view = 0 🔗

  • void set_sparse_indices_buffer_view(value: int)

  • int get_sparse_indices_buffer_view()

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.


int sparse_indices_byte_offset = 0 🔗

  • void set_sparse_indices_byte_offset(value: int)

  • int get_sparse_indices_byte_offset()

The offset relative to the start of the buffer view in bytes.


int sparse_indices_component_type = 0 🔗

  • void set_sparse_indices_component_type(value: int)

  • int get_sparse_indices_component_type()

The indices component data type as an enum. Possible values are 5121 for "UNSIGNED_BYTE", 5123 for "UNSIGNED_SHORT", and 5125 for "UNSIGNED_INT".


int sparse_values_buffer_view = 0 🔗

  • void set_sparse_values_buffer_view(value: int)

  • int get_sparse_values_buffer_view()

The index of the bufferView with sparse values. The referenced buffer view MUST NOT have its target or byteStride properties defined.


int sparse_values_byte_offset = 0 🔗

  • void set_sparse_values_byte_offset(value: int)

  • int get_sparse_values_byte_offset()

The offset relative to the start of the bufferView in bytes.


int type = 0 🔗

  • void set_type(value: int)

  • int get_type()

已弃用: Use accessor_type instead.

The GLTF accessor type as an enum. Use accessor_type instead.