UNPKG

21.6 kBSource Map (JSON)View Raw
1{"version":3,"file":"Geometry.mjs","sources":["../../src/geometry/Geometry.ts"],"sourcesContent":["import { BUFFER_TYPE } from '@pixi/constants';\nimport { Runner } from '@pixi/runner';\nimport { getBufferType } from '@pixi/utils';\nimport { Attribute } from './Attribute';\nimport { Buffer } from './Buffer';\nimport { interleaveTypedArrays } from './utils/interleaveTypedArrays';\n\nimport type { TYPES } from '@pixi/constants';\nimport type { Dict } from '@pixi/utils';\nimport type { IArrayBuffer } from './Buffer';\n\nconst byteSizeMap: {[key: number]: number} = { 5126: 4, 5123: 2, 5121: 1 };\nlet UID = 0;\n\n/* eslint-disable object-shorthand */\nconst map: Dict<any> = {\n Float32Array: Float32Array,\n Uint32Array: Uint32Array,\n Int32Array: Int32Array,\n Uint8Array: Uint8Array,\n Uint16Array: Uint16Array,\n};\n\n/* eslint-disable max-len */\n\n/**\n * The Geometry represents a model. It consists of two components:\n * - GeometryStyle - The structure of the model such as the attributes layout\n * - GeometryData - the data of the model - this consists of buffers.\n * This can include anything from positions, uvs, normals, colors etc.\n *\n * Geometry can be defined without passing in a style or data if required (thats how I prefer!)\n * @example\n * import { Geometry } from 'pixi.js';\n *\n * const geometry = new Geometry();\n *\n * geometry.addAttribute('positions', [0, 0, 100, 0, 100, 100, 0, 100], 2);\n * geometry.addAttribute('uvs', [0, 0, 1, 0, 1, 1, 0, 1], 2);\n * geometry.addIndex([0, 1, 2, 1, 3, 2]);\n * @memberof PIXI\n */\nexport class Geometry\n{\n public buffers: Array<Buffer>;\n public indexBuffer: Buffer;\n public attributes: {[key: string]: Attribute};\n public id: number;\n\n /** Whether the geometry is instanced. */\n public instanced: boolean;\n\n /**\n * Number of instances in this geometry, pass it to `GeometrySystem.draw()`.\n * @default 1\n */\n public instanceCount: number;\n\n /**\n * A map of renderer IDs to webgl VAOs\n * @type {object}\n */\n glVertexArrayObjects: {[key: number]: {[key: string]: WebGLVertexArrayObject}};\n disposeRunner: Runner;\n\n /** Count of existing (not destroyed) meshes that reference this geometry. */\n refCount: number;\n\n /**\n * @param buffers - An array of buffers. optional.\n * @param attributes - Of the geometry, optional structure of the attributes layout\n */\n constructor(buffers: Array<Buffer> = [], attributes: {[key: string]: Attribute} = {})\n {\n this.buffers = buffers;\n\n this.indexBuffer = null;\n\n this.attributes = attributes;\n\n this.glVertexArrayObjects = {};\n\n this.id = UID++;\n\n this.instanced = false;\n this.instanceCount = 1;\n\n this.disposeRunner = new Runner('disposeGeometry');\n this.refCount = 0;\n }\n\n /**\n *\n * Adds an attribute to the geometry\n * Note: `stride` and `start` should be `undefined` if you dont know them, not 0!\n * @param id - the name of the attribute (matching up to a shader)\n * @param {PIXI.Buffer|number[]} buffer - the buffer that holds the data of the attribute . You can also provide an Array and a buffer will be created from it.\n * @param size - the size of the attribute. If you have 2 floats per vertex (eg position x and y) this would be 2\n * @param normalized - should the data be normalized.\n * @param [type=PIXI.TYPES.FLOAT] - what type of number is the attribute. Check {@link PIXI.TYPES} to see the ones available\n * @param [stride=0] - How far apart, in bytes, the start of each value is. (used for interleaving data)\n * @param [start=0] - How far into the array to start reading values (used for interleaving data)\n * @param instance - Instancing flag\n * @returns - Returns self, useful for chaining.\n */\n addAttribute(id: string, buffer: Buffer | Float32Array | Uint32Array | Array<number>, size = 0, normalized = false,\n type?: TYPES, stride?: number, start?: number, instance = false): this\n {\n if (!buffer)\n {\n throw new Error('You must pass a buffer when creating an attribute');\n }\n\n // check if this is a buffer!\n if (!(buffer instanceof Buffer))\n {\n // its an array!\n if (buffer instanceof Array)\n {\n buffer = new Float32Array(buffer);\n }\n\n buffer = new Buffer(buffer);\n }\n\n const ids = id.split('|');\n\n if (ids.length > 1)\n {\n for (let i = 0; i < ids.length; i++)\n {\n this.addAttribute(ids[i], buffer, size, normalized, type);\n }\n\n return this;\n }\n\n let bufferIndex = this.buffers.indexOf(buffer);\n\n if (bufferIndex === -1)\n {\n this.buffers.push(buffer);\n bufferIndex = this.buffers.length - 1;\n }\n\n this.attributes[id] = new Attribute(bufferIndex, size, normalized, type, stride, start, instance);\n\n // assuming that if there is instanced data then this will be drawn with instancing!\n this.instanced = this.instanced || instance;\n\n return this;\n }\n\n /**\n * Returns the requested attribute.\n * @param id - The name of the attribute required\n * @returns - The attribute requested.\n */\n getAttribute(id: string): Attribute\n {\n return this.attributes[id];\n }\n\n /**\n * Returns the requested buffer.\n * @param id - The name of the buffer required.\n * @returns - The buffer requested.\n */\n getBuffer(id: string): Buffer\n {\n return this.buffers[this.getAttribute(id).buffer];\n }\n\n /**\n *\n * Adds an index buffer to the geometry\n * The index buffer contains integers, three for each triangle in the geometry, which reference the various attribute buffers (position, colour, UV coordinates, other UV coordinates, normal, …). There is only ONE index buffer.\n * @param {PIXI.Buffer|number[]} [buffer] - The buffer that holds the data of the index buffer. You can also provide an Array and a buffer will be created from it.\n * @returns - Returns self, useful for chaining.\n */\n addIndex(buffer?: Buffer | IArrayBuffer | number[]): Geometry\n {\n if (!(buffer instanceof Buffer))\n {\n // its an array!\n if (buffer instanceof Array)\n {\n buffer = new Uint16Array(buffer);\n }\n\n buffer = new Buffer(buffer);\n }\n\n buffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n\n this.indexBuffer = buffer;\n\n if (!this.buffers.includes(buffer))\n {\n this.buffers.push(buffer);\n }\n\n return this;\n }\n\n /**\n * Returns the index buffer\n * @returns - The index buffer.\n */\n getIndex(): Buffer\n {\n return this.indexBuffer;\n }\n\n /**\n * This function modifies the structure so that all current attributes become interleaved into a single buffer\n * This can be useful if your model remains static as it offers a little performance boost\n * @returns - Returns self, useful for chaining.\n */\n interleave(): Geometry\n {\n // a simple check to see if buffers are already interleaved..\n if (this.buffers.length === 1 || (this.buffers.length === 2 && this.indexBuffer)) return this;\n\n // assume already that no buffers are interleaved\n const arrays = [];\n const sizes = [];\n const interleavedBuffer = new Buffer();\n let i;\n\n for (i in this.attributes)\n {\n const attribute = this.attributes[i];\n\n const buffer = this.buffers[attribute.buffer];\n\n arrays.push(buffer.data);\n\n sizes.push((attribute.size * byteSizeMap[attribute.type]) / 4);\n\n attribute.buffer = 0;\n }\n\n interleavedBuffer.data = interleaveTypedArrays(arrays, sizes);\n\n for (i = 0; i < this.buffers.length; i++)\n {\n if (this.buffers[i] !== this.indexBuffer)\n {\n this.buffers[i].destroy();\n }\n }\n\n this.buffers = [interleavedBuffer];\n\n if (this.indexBuffer)\n {\n this.buffers.push(this.indexBuffer);\n }\n\n return this;\n }\n\n /** Get the size of the geometries, in vertices. */\n getSize(): number\n {\n for (const i in this.attributes)\n {\n const attribute = this.attributes[i];\n const buffer = this.buffers[attribute.buffer];\n\n return (buffer.data as any).length / ((attribute.stride / 4) || attribute.size);\n }\n\n return 0;\n }\n\n /** Disposes WebGL resources that are connected to this geometry. */\n dispose(): void\n {\n this.disposeRunner.emit(this, false);\n }\n\n /** Destroys the geometry. */\n destroy(): void\n {\n this.dispose();\n\n this.buffers = null;\n this.indexBuffer = null;\n this.attributes = null;\n }\n\n /**\n * Returns a clone of the geometry.\n * @returns - A new clone of this geometry.\n */\n clone(): Geometry\n {\n const geometry = new Geometry();\n\n for (let i = 0; i < this.buffers.length; i++)\n {\n geometry.buffers[i] = new Buffer(this.buffers[i].data.slice(0));\n }\n\n for (const i in this.attributes)\n {\n const attrib = this.attributes[i];\n\n geometry.attributes[i] = new Attribute(\n attrib.buffer,\n attrib.size,\n attrib.normalized,\n attrib.type,\n attrib.stride,\n attrib.start,\n attrib.instance\n );\n }\n\n if (this.indexBuffer)\n {\n geometry.indexBuffer = geometry.buffers[this.buffers.indexOf(this.indexBuffer)];\n geometry.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n }\n\n return geometry;\n }\n\n /**\n * Merges an array of geometries into a new single one.\n *\n * Geometry attribute styles must match for this operation to work.\n * @param geometries - array of geometries to merge\n * @returns - Shiny new geometry!\n */\n static merge(geometries: Array<Geometry>): Geometry\n {\n // todo add a geometry check!\n // also a size check.. cant be too big!]\n\n const geometryOut = new Geometry();\n\n const arrays = [];\n const sizes: Array<number> = [];\n const offsets = [];\n\n let geometry;\n\n // pass one.. get sizes..\n for (let i = 0; i < geometries.length; i++)\n {\n geometry = geometries[i];\n\n for (let j = 0; j < geometry.buffers.length; j++)\n {\n sizes[j] = sizes[j] || 0;\n sizes[j] += geometry.buffers[j].data.length;\n offsets[j] = 0;\n }\n }\n\n // build the correct size arrays..\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n // TODO types!\n arrays[i] = new map[getBufferType(geometry.buffers[i].data)](sizes[i]);\n geometryOut.buffers[i] = new Buffer(arrays[i]);\n }\n\n // pass to set data..\n for (let i = 0; i < geometries.length; i++)\n {\n geometry = geometries[i];\n\n for (let j = 0; j < geometry.buffers.length; j++)\n {\n arrays[j].set(geometry.buffers[j].data, offsets[j]);\n offsets[j] += geometry.buffers[j].data.length;\n }\n }\n\n geometryOut.attributes = geometry.attributes;\n\n if (geometry.indexBuffer)\n {\n geometryOut.indexBuffer = geometryOut.buffers[geometry.buffers.indexOf(geometry.indexBuffer)];\n geometryOut.indexBuffer.type = BUFFER_TYPE.ELEMENT_ARRAY_BUFFER;\n\n let offset = 0;\n let stride = 0;\n let offset2 = 0;\n let bufferIndexToCount = 0;\n\n // get a buffer\n for (let i = 0; i < geometry.buffers.length; i++)\n {\n if (geometry.buffers[i] !== geometry.indexBuffer)\n {\n bufferIndexToCount = i;\n break;\n }\n }\n\n // figure out the stride of one buffer..\n for (const i in geometry.attributes)\n {\n const attribute = geometry.attributes[i];\n\n if ((attribute.buffer | 0) === bufferIndexToCount)\n {\n stride += ((attribute.size * byteSizeMap[attribute.type]) / 4);\n }\n }\n\n // time to off set all indexes..\n for (let i = 0; i < geometries.length; i++)\n {\n const indexBufferData = geometries[i].indexBuffer.data;\n\n for (let j = 0; j < indexBufferData.length; j++)\n {\n geometryOut.indexBuffer.data[j + offset2] += offset;\n }\n\n offset += geometries[i].buffers[bufferIndexToCount].data.length / (stride);\n offset2 += indexBufferData.length;\n }\n }\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