Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CuboidGeometry

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

Hierarchy

Implements

Index

Constructors

constructor

  • Object constructor, requires a context and an identifier.

    Parameters

    • context: Context

      Valid context to create the object for.

    • Optional identifier: undefined | string

      Meaningful name for identification of this instance.

    • Default value uvCoordinates: boolean = false

      Create uv coordinates for texturing?

    • Default value extent: GLfloat3 | vec3 = [1.0, 1.0, 1.0]

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

    Returns CuboidGeometry

Properties

Protected _buffers

_buffers: Buffer[] = new Array<Buffer>()

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

Protected _count

_count: GLsizei

Protected _extent

_extent: vec3 = vec3.fromValues(1.0, 1.0, 1.0)
see

extent

Protected _uvCoordLocation

_uvCoordLocation: GLuint
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: GLuint = 0

Static Protected INDICES

INDICES: Uint8Array = new Uint8Array([0, 1, 2, 3, 7, 1, 5, 4, 7, 6, 2, 4, 0, 1])

Static Protected INDICES_UV

INDICES_UV: Uint8Array = new Uint8Array([3, 2, 1, 0, /*PR*/ 10, 19, 11, /*PR*/ 18, 11, 17, 16, /*PR*/ 4, 16, 5, 6,/*PR*/ 7, 6, 8, 9, /*PR*/ 10, 9, 11, /*PR*/ 12, 13, 14, 15])

Static Protected VERTICES

VERTICES: Float32Array = new Float32Array([-1, -1, +1, +1, -1, +1, -1, +1, +1, +1, +1, +1, -1, -1, -1, +1, -1, -1, -1, +1, -1, +1, +1, -1])

Static Protected VERTICES_UV

VERTICES_UV: Float32Array = new Float32Array([-1, -1, +1, 0, 0, +1, -1, +1, 1, 0, -1, +1, +1, 0, 1, +1, +1, +1, 1, 1,-1, +1, +1, 0, 0, +1, +1, +1, 1, 0, +1, +1, -1, 1, 1, +1, +1, +1, 0, 1,+1, -1, +1, 0, 0, +1, -1, -1, 1, 0, +1, -1, +1, 1, 1, -1, -1, -1, 0, 0,+1, -1, -1, 0, 0, -1, -1, -1, 1, 0, +1, +1, -1, 0, 1, -1, +1, -1, 1, 1,-1, +1, -1, 0, 1, -1, +1, +1, 1, 1, -1, -1, +1, 1, 0, -1, -1, +1, 0, 1,])

Accessors

buffers

  • get buffers(): Array<Buffer>

context

extent

  • get extent(): vec3

initialized

  • get initialized(): boolean

uvCoordLocation

  • get uvCoordLocation(): GLuint
  • Attribute location to which this geometry's texture coordinates are bound to.

    Returns GLuint

vertexArray

vertexLocation

  • get vertexLocation(): GLuint

Methods

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.

    Returns void

Protected assertUninitialized

  • assertUninitialized(): undefined
  • 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.

    Returns undefined

bind

  • bind(): void

Protected bindBuffers

  • bindBuffers(): void

draw

  • draw(): void

initialize

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

    Parameters

    • Default value vertexLocation: GLuint = 0

      Attribute binding point for vertices.

    • Default value uvCoordLocation: GLuint = 1

      Attribute binding point for texture coordinates.

    Returns boolean

unbind

  • unbind(): void

Protected unbindBuffers

  • unbindBuffers(): void

uninitialize

  • uninitialize(): void

Static Protected assertInitializedFalse

Static Protected assertUninitializedFalse

Static assert_initialized

Static assert_uninitialized

Static initialize

  • 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

  • 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