import { vec3 } from 'gl-matrix'; import { Context } from '../context'; import { Geometry } from '../geometry'; import { GLfloat3 } from '../tuples'; /** * Geometry of a box with configurable size and texture coordinates (optional). */ export declare class CuboidGeometry extends Geometry { protected static readonly VERTICES: Float32Array; protected static readonly INDICES: Uint8Array; protected static readonly VERTICES_UV: Float32Array; protected static readonly INDICES_UV: Uint8Array; /** @see {@link vertexLocation} */ protected _vertexLocation: GLuint; /** @see {@link textCoordLocation} */ protected _uvCoordLocation: GLuint; /** @see {@link extent} */ protected _extent: vec3; /** @see {@link uvCoordinates} */ protected _uvCoordinates: boolean; protected _count: GLsizei; /** * Object constructor, requires a context and an identifier. * @param context - Valid context to create the object for. * @param identifier - Meaningful name for identification of this instance. * @param uvCoordinates - Create uv coordinates for texturing? * @param extent - Width, height, and depth of the cuboid (for backing vertices). */ constructor(context: Context, identifier?: string, uvCoordinates?: boolean, extent?: GLfloat3 | vec3); /** * Binds the vertex buffer object (VBO) to an attribute binding point of a given, pre-defined index. */ protected bindBuffers(): void; /** * Unbinds the vertex buffer object (VBO) and disables the binding point. */ protected unbindBuffers(): void; /** * Creates the vertex buffer object (VBO) and creates and initializes the buffer's data store. * @param vertexLocation - Attribute binding point for vertices. * @param uvCoordLocation - Attribute binding point for texture coordinates. */ initialize(vertexLocation?: GLuint, uvCoordLocation?: GLuint): boolean; /** * Draws the box. */ draw(): void; /** * Attribute location to which this geometry's vertices are bound to. */ get vertexLocation(): GLuint; /** * Attribute location to which this geometry's texture coordinates are bound to. */ get uvCoordLocation(): GLuint; /** * The cuboid's extent in width, height, and depth. */ get extent(): vec3; /** * The cuboid's index buffer length. */ get count(): GLsizei; }