Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Geometry

The geometry class for managing buffer resource

Hierarchy

Index

Constructors

constructor

  • new Geometry(gl: WebGLRenderingContext): Geometry

Properties

aabb

aabb: AABB = new AABB([Vector3.Zero])

accessors

accessors: object

Type declaration

buffers

buffers: Buffer[] = []

Vertex buffer

type

{Buffer[]}

gl

gl: WebGLRenderingContext

indices

indices: object

Type declaration

Accessors

accessorHash

  • get accessorHash(): number
  • Hash calculator of accessors map. If this value was same with the other geometry, the 2 geometries have same accessors. 'Same' DOES NOT mean that these geometries have a buffers containing same elements. But, if there was a accessor named 'A' in one of them, the other one should exist.

    Returns number

Methods

addAttributes

  • addAttributes(buffer: number[] | BufferSource, accessors: object, usage?: number): void
  • addAttributes(buffer: number[] | BufferSource | Buffer, accessors: object): void

addIndex

  • addIndex(indexName: string, instanceCount: number, buffer: Buffer | number[] | BufferSource, topology?: number, offset?: number, count?: number, type?: number): void
  • addIndex(indexName: string, buffer: Buffer | number[] | BufferSource, topology?: number, offset?: number, count?: number, type?: number): void
  • add new index buffer to this geometry.

    Parameters

    • indexName: string
    • instanceCount: number
    • buffer: Buffer | number[] | BufferSource
    • Optional topology: number
    • Optional offset: number
    • Optional count: number
    • Optional type: number

    Returns void

  • Parameters

    • indexName: string
    • buffer: Buffer | number[] | BufferSource
    • Optional topology: number
    • Optional offset: number
    • Optional count: number
    • Optional type: number

    Returns void

clone

drawByDefault

  • drawByDefault(indexName: string, attribNames: string[], program: Program, count?: number, offset?: number): void
  • Parameters

    • indexName: string
    • attribNames: string[]
    • program: Program
    • Default value count: number = Number.MAX_VALUE
    • Default value offset: number = 0

    Returns void

Static bindBufferToAttribute

  • bindBufferToAttribute(geometry: Geometry, program: Program, attributeName: string, semantics: string): boolean
  • bind a vertex buffer to specified attribute variable.

    Parameters

    • geometry: Geometry
    • program: Program
    • attributeName: string
    • semantics: string

    Returns boolean

    [description]

Static drawWithCurrentVertexBuffer

  • drawWithCurrentVertexBuffer(geometry: Geometry, indexName: string, count?: number, offset?: number): void
  • Parameters

    • geometry: Geometry
    • indexName: string
    • Default value count: number = Number.MAX_VALUE
    • Default value offset: number = 0

    Returns void

Generated using TypeDoc