Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GFXInputAssembler

GFX输入汇集器。

Hierarchy

Index

Constructors

constructor

Properties

Protected _attributes

_attributes: IGFXAttribute[] = []

Protected _device

_device: GFXDevice

GFX设备。

Protected _firstIndex

_firstIndex: number = 0

Protected _firstInstance

_firstInstance: number = 0

Protected _firstVertex

_firstVertex: number = 0

Protected _gfxType

_gfxType: GFXObjectType = GFXObjectType.UNKNOWN

对象类型。

Protected _indexBuffer

_indexBuffer: GFXBuffer | null = null

Protected _indexCount

_indexCount: number = 0

Protected _indirectBuffer

_indirectBuffer: GFXBuffer | null = null

Protected _instanceCount

_instanceCount: number = 0

Protected _isIndirect

_isIndirect: boolean = false

Protected _status

_status: GFXStatus = GFXStatus.UNREADY

对象状态。

Protected _vertexBuffers

_vertexBuffers: GFXBuffer[] = []

Protected _vertexCount

_vertexCount: number = 0

Protected _vertexOffset

_vertexOffset: number = 0

Accessors

attributes

firstIndex

  • get firstIndex(): number
  • set firstIndex(first: number): void

firstInstance

  • get firstInstance(): number
  • set firstInstance(first: number): void

firstVertex

  • get firstVertex(): number
  • set firstVertex(first: number): void

gfxType

indexBuffer

indexCount

  • get indexCount(): number
  • set indexCount(count: number): void

indirectBuffer

instanceCount

  • get instanceCount(): number
  • set instanceCount(count: number): void

isIndirect

  • get isIndirect(): boolean

status

vertexBuffers

vertexCount

  • get vertexCount(): number
  • set vertexCount(count: number): void

vertexOffset

  • get vertexOffset(): number
  • set vertexOffset(offset: number): void

Methods

Abstract destroy

  • destroy(): void

extractDrawInfo

getVertexBuffer

  • getVertexBuffer(stream?: number): GFXBuffer | null

Abstract initialize

updateIndexBuffer

  • 更新索引缓冲数据,如果索引数量改变了,需要在此函数后调用 submodel.updateCommandBuffer

    example
    // get IB array buffer from mesh, better to cache this somewhere convenient
    const ibInfo = mesh.struct.primitives[0].indexView;
    const ibuffer = mesh.data.buffer.slice(ibInfo.offset, ibInfo.offset + ibInfo.length);
    const submodel = someModelComponent.model.getSubModel(0);
    submodel.inputAssembler.updateIndexBuffer(ibuffer, [0, 1, 2]);
    submodel.updateCommandBuffer(); // index count changed

    Parameters

    • ibuffer: GFXBufferSource

      缓冲数据源。

    • data: number[]

      更新数据。

    Returns void

updateVertexAttr

  • updateVertexAttr(vbuffer: GFXBufferSource, attr: string, data: number[], index?: number, final?: boolean): void
  • 根据顶点属性名称更新顶点缓冲数据。

    example
    // get VB array buffer from mesh, better to cache this somewhere convenient
    const vbInfo = mesh.struct.vertexBundles[mesh.struct.primitives[0].vertexBundelIndices[0]].view;
    const vbuffer = mesh.data.buffer.slice(vbInfo.offset, vbInfo.offset + vbInfo.length);
    const submodel = someModelComponent.model.getSubModel(0);
    // say the new positions is stored in 'data' as a plain array
    submodel.inputAssembler.updateVertexBuffer(vbuffer, cc.GFXAttributeName.ATTR_POSITION, data);

    Parameters

    • vbuffer: GFXBufferSource

      缓冲数据源。

    • attr: string

      属性名。

    • data: number[]

      更新数据。

    • Default value index: number = 0

      要更新第几号顶点缓冲?(默认为 0)

    • Default value final: boolean = true

      是否立即更新?(默认为 true,需要一次修改多个属性时可以使用)

    Returns void

Generated using TypeDoc