Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CuboidGeometry

Geometry of a box with configurable size and texture coordinates (optional).

Hierarchy

Index

Constructors

constructor

  • Object constructor, requires a context and an identifier.

    Parameters

    • context: Context

      Valid context to create the object for.

    • Optional identifier: string

      Meaningful name for identification of this instance.

    • uvCoordinates: boolean = false

      Create uv coordinates for texturing?

    • extent: vec3 | GLfloat3 = ...

      Width, height, and depth of the cuboid (for backing vertices).

    Returns CuboidGeometry

Properties

Protected _buffers

_buffers: Buffer[] = ...

Various buffers required for this geometry (e.g., vertex buffer).

Protected _count

_count: number

Protected _extent

_extent: vec3 = ...
see

extent

Protected _uvCoordLocation

_uvCoordLocation: number
see

{@link textCoordLocation}

Protected _uvCoordinates

_uvCoordinates: boolean = false
see

{@link uvCoordinates}

Protected _vertexArray

_vertexArray: VertexArray

Vertex array used for binding the rectangle's buffer(s).

Protected _vertexLocation

_vertexLocation: number = 0

Protected assertInitialized

assertInitialized: () => void = ...

Asserts the objects initialization status to be true. Note that the implementation is cached and forwarded to either an empty function when initialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Protected assertUninitialized

assertUninitialized: () => void = ...

Asserts the objects initialization status to be false. Note that the implementation is cached and forwarded to either an empty function when uninitialized and to an acutal assert(false) otherwise.

Type declaration

    • (): void
    • Returns void

Static Protected Readonly INDICES

INDICES: Uint8Array = ...

Static Protected Readonly INDICES_UV

INDICES_UV: Uint8Array = ...

Static Protected Readonly VERTICES

VERTICES: Float32Array = ...

Static Protected Readonly VERTICES_UV

VERTICES_UV: Float32Array = ...

Accessors

buffers

context

count

  • get count(): number

extent

  • get extent(): vec3

initialized

  • get initialized(): boolean
  • Property getter for readonly access to the initialization status of an initializable instance.

    Returns boolean

uvCoordLocation

  • get uvCoordLocation(): number

vertexArray

vertexLocation

  • get vertexLocation(): number

Methods

bind

  • bind(): void

Protected bindBuffers

  • bindBuffers(): void

draw

  • draw(): void

initialize

  • initialize(vertexLocation?: number, uvCoordLocation?: number): boolean
  • Creates the vertex buffer object (VBO) and creates and initializes the buffer's data store.

    Parameters

    • vertexLocation: number = 0

      Attribute binding point for vertices.

    • uvCoordLocation: number = 1

      Attribute binding point for texture coordinates.

    Returns boolean

unbind

  • unbind(): void

Protected unbindBuffers

  • unbindBuffers(): void

uninitialize

  • uninitialize(): void

Static Protected Readonly assertInitializedFalse

Static Protected Readonly assertUninitializedFalse

Static assert_initialized

  • assert_initialized(): MethodDecorator

Static assert_uninitialized

  • assert_uninitialized(): MethodDecorator

Static discard

  • discard(): MethodDecorator
  • Method decorator for discarding of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be discarded, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator

Static initialize

  • initialize(): MethodDecorator
  • Method decorator for initialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be initialized, invokes its initialization with arbitrary number of parameters, and sets the initialization status to the initialization success (either false or true). In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to either a static, always-failing assert or an empty/undefined function.

    Returns MethodDecorator

Static uninitialize

  • uninitialize(): MethodDecorator
  • Method decorator for uninitialization of Initializable inheritors. This decorator asserts the initialization status of the instance that is to be uninitialized, invokes its uninitialization, and falsifies the initialization status. In order to encourage the use of assertInitialized and assertUninitialized they are dynamically bound to a static, always-failing assert and an empty/undefined function respectively.

    Returns MethodDecorator