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.

GLTFBufferView

Eredita: Resource < RefCounted < Object

Rappresenta una buffer view glTF.

Descrizione

GLTFBufferView è una struttura dati che rappresenta glTF una bufferView che si troverebbe nell'array "bufferViews". Un buffer è un blob di dati binari. Una buffer view è una porzione di un buffer che può essere utilizzata per identificare ed estrarre dati dal buffer.

La maggior parte degli usi personalizzati dei buffer necessita solo di usare buffer, byte_length e byte_offset. Le proprietà byte_stride e indices sono per casi d'uso più avanzati come dati mesh interlacciati codificati per la GPU.

Tutorial

Proprietà

int

buffer

-1

int

byte_length

0

int

byte_offset

0

int

byte_stride

-1

bool

indices

false

bool

vertex_attributes

false

Metodi

GLTFBufferView

from_dictionary(dictionary: Dictionary) static

PackedByteArray

load_buffer_view_data(state: GLTFState) const

Dictionary

to_dictionary() const


Descrizioni delle proprietà

int buffer = -1 🔗

  • void set_buffer(value: int)

  • int get_buffer()

L'indice del buffer a cui fa riferimento questa buffer view. Se -1, questa buffer view non fa riferimento ad alcun buffer.


int byte_length = 0 🔗

  • void set_byte_length(value: int)

  • int get_byte_length()

La lunghezza, in byte, di questa buffer view. Se 0, questa buffer view è vuota.


int byte_offset = 0 🔗

  • void set_byte_offset(value: int)

  • int get_byte_offset()

L'offset, in byte, dall'inizio del buffer all'inizio di questa buffer view.


int byte_stride = -1 🔗

  • void set_byte_stride(value: int)

  • int get_byte_stride()

Il passo, in byte, tra i dati interlacciati. Se -1, questa buffer view non è interlacciata.


bool indices = false 🔗

  • void set_indices(value: bool)

  • bool get_indices()

true se il tipo del buffer GPU OpenGL del GLTFBufferView è un ELEMENT_ARRAY_BUFFER utilizzato per gli indici dei vertici (costante intera 34963). false se il tipo di buffer è un qualunque altro valore. Consulta Buffer, BufferView e Accessor per i valori possibili. Questa proprietà viene impostata all'importazione e utilizzata all'esportazione.


bool vertex_attributes = false 🔗

  • void set_vertex_attributes(value: bool)

  • bool get_vertex_attributes()

true se il tipo di buffer GPU OpenGL del GLTFBufferView è un ARRAY_BUFFER utilizzato per gli indici dei vertici (costante intera 34962). false se il tipo di buffer è un qualunque altro valore. Consulta Buffer, BufferView e Accessor per i valori possibili. Questa proprietà viene impostata all'importazione e utilizzata all'esportazione.


Descrizioni dei metodi

GLTFBufferView from_dictionary(dictionary: Dictionary) static 🔗

Creates a new GLTFBufferView instance by parsing the given Dictionary.


PackedByteArray load_buffer_view_data(state: GLTFState) const 🔗

Carica i dati della buffer view dal buffer a cui fa riferimento questa buffer view nel GLTFState fornito. I dati interlacciati con un byte stride non sono ancora supportati da questo metodo. I dati sono restituiti come PackedByteArray.


Dictionary to_dictionary() const 🔗

Serializes this GLTFBufferView instance into a Dictionary.