GLTFBufferView

继承: Resource < RefCounted < Object

Represents a glTF buffer view.

描述

GLTFBufferView is a data structure representing a glTF bufferView that would be found in the "bufferViews" array. A buffer is a blob of binary data. A buffer view is a slice of a buffer that can be used to identify and extract data from the buffer.

Most custom uses of buffers only need to use the buffer, byte_length, and byte_offset. The byte_stride and indices properties are for more advanced use cases such as interleaved mesh data encoded for the GPU.

属性

方法


属性说明

int buffer = -1

  • void set_buffer ( value: int )
  • int get_buffer ( )

The index of the buffer this buffer view is referencing. If -1, this buffer view is not referencing any buffer.


int byte_length = 0

  • void set_byte_length ( value: int )
  • int get_byte_length ( )

The length, in bytes, of this buffer view. If 0, this buffer view is empty.


int byte_offset = 0

  • void set_byte_offset ( value: int )
  • int get_byte_offset ( )

The offset, in bytes, from the start of the buffer to the start of this buffer view.


int byte_stride = -1

  • void set_byte_stride ( value: int )
  • int get_byte_stride ( )

The stride, in bytes, between interleaved data. If -1, this buffer view is not interleaved.


bool indices = false

  • void set_indices ( value: bool )
  • bool get_indices ( )

True if the GLTFBufferView's OpenGL GPU buffer type is an ELEMENT_ARRAY_BUFFER used for vertex indices (integer constant 34963). False if the buffer type is any other value. See Buffers, BufferViews, and Accessors for possible values. This property is set on import and used on export.


bool vertex_attributes = false

  • void set_vertex_attributes ( value: bool )
  • bool get_vertex_attributes ( )

True if the GLTFBufferView's OpenGL GPU buffer type is an ARRAY_BUFFER used for vertex attributes (integer constant 34962). False if the buffer type is any other value. See Buffers, BufferViews, and Accessors for possible values. This property is set on import and used on export.


方法说明

PackedByteArray load_buffer_view_data ( state: GLTFState ) const1

Loads the buffer view data from the buffer referenced by this buffer view in the given GLTFState. Interleaved data with a byte stride is not yet supported by this method. The data is returned as a PackedByteArray.

2

本方法通常需要用户覆盖才能生效。

1

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。