diff --git a/package-lock.json b/package-lock.json index 1853d7f0..4efc3e1f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lakuna/umbra.js", - "version": "4.0.0", + "version": "5.0.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lakuna/umbra.js", - "version": "4.0.0", + "version": "5.0.0", "license": "MIT", "devDependencies": { "@typescript-eslint/eslint-plugin": "^5.29.0", diff --git a/package.json b/package.json index 8f259f90..08541d95 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lakuna/umbra.js", - "version": "4.0.0", + "version": "5.0.0", "description": "A lightweight visual application framework for WebGL.", "keywords": [ "front-end", diff --git a/src/index.ts b/src/index.ts index 376a5213..a4a7e411 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,6 @@ export * from "./types/TypedArray.js"; export * from "./utility/clearContext.js"; export * from "./utility/Color.js"; -export * from "./utility/Geometry.js"; export * from "./utility/makeFullscreenCanvas.js"; export * from "./utility/resizeContext.js"; export * from "./webgl/Attribute.js"; diff --git a/src/utility/Geometry.ts b/src/utility/Geometry.ts deleted file mode 100644 index dfca4814..00000000 --- a/src/utility/Geometry.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** A shape. */ -export class Geometry { - /** - * Creates a shape. - * @param positions The clip space coordinates of the vertices of the shape. - * @param texcoords The texture space coordinates of the vertices of the shape for the texture applied to the shape. - * @param normals The normal values of the vertices of the shape. - * @param indices The indices of the shape. - */ - public constructor(positions: Float32Array, texcoords?: Float32Array, normals?: Float32Array, indices?: Uint8Array) { - this.positions = positions; - if (texcoords) { this.texcoords = texcoords; } - if (normals) { this.normals = normals; } - if (indices) { this.indices = indices; } - } - - /** The clip space coordinates of the vertices of this shape. */ - public readonly positions: Float32Array; - - /** The texture space coordinates of the vertices of this shape for the texture applied to this shape. */ - public readonly texcoords?: Float32Array; - - /** The normal values of the vertices of this shape. */ - public readonly normals?: Float32Array; - - /** The indices of this shape. */ - public readonly indices?: Uint8Array; -} diff --git a/src/webgl/VAO.ts b/src/webgl/VAO.ts index 771b3059..2d0fbe52 100644 --- a/src/webgl/VAO.ts +++ b/src/webgl/VAO.ts @@ -2,31 +2,10 @@ import { Program } from "./Program.js"; import { AttributeState } from "./AttributeState.js"; import { Buffer } from "./Buffer.js"; import { BufferTarget, Primitive } from "./WebGLConstant.js"; -import { Geometry } from "../utility/Geometry.js" import { Framebuffer } from "./Framebuffer.js"; /** A collection of attribute state; a vertex attribute array. */ export class VAO { - /** - * Creates a vertex array object from a shape. - * @param program The program that the VAO is used with. - * @param geometry The shape to create the VAO from. - * @param positionAttributeName The name of the attribute that position data will be supplied to. - * @param texcoordAttributeName The name of the attribute that texture coordinate data will be supplied to. - * @param normalAttributeName The name of the attribute that normal data will be supplied to. - */ - public static fromGeometry(program: Program, geometry: Geometry, positionAttributeName: string, texcoordAttributeName?: string, normalAttributeName?: string): VAO { - const attributes: Array = []; - attributes.push(new AttributeState(positionAttributeName, new Buffer(program.gl, geometry.positions))); - if (texcoordAttributeName && geometry.texcoords?.length) { - attributes.push(new AttributeState(texcoordAttributeName, new Buffer(program.gl, geometry.texcoords))); - } - if (normalAttributeName && geometry.normals?.length) { - attributes.push(new AttributeState(normalAttributeName, new Buffer(program.gl, geometry.normals))); - } - return new VAO(program, attributes, geometry.indices); - } - /** * Creates a vertex array object. * @param program The program that the VAO is used with.