UNPKG

@spearwolf/twopoint5d

Version:

Create 2.5D realtime graphics and pixelart with WebGL and three.js

25 lines 1.3 kB
import cloneVertexObjectDescription from '../../vertex-objects/cloneVertexObjectDescription.js'; import { InstancedVertexObjectGeometry } from '../../vertex-objects/InstancedVertexObjectGeometry.js'; import { BaseSpriteDescriptor } from '../BaseSprite.js'; import { TexturedSpriteDescriptor } from './TexturedSprite.js'; export class TexturedSpritesGeometry extends InstancedVertexObjectGeometry { constructor(capacity = 100, makeBaseSpriteArgs = [0.5, 0.5]) { const cap = typeof capacity === 'number' ? capacity : capacity.capacity; const desc = typeof capacity === 'number' ? TexturedSpriteDescriptor : cloneVertexObjectDescription(TexturedSpriteDescriptor, { dynamic: capacity.attributeUsage?.dynamic, stream: capacity.attributeUsage?.stream, static: capacity.attributeUsage?.static, alias: { size: ['quadSize'], position: ['instancePosition'], }, }); super(desc, cap, BaseSpriteDescriptor); this.isTexturedSpritesGeometry = true; this.name = 'twopoint5d.TexturedSpritesGeometry'; this.basePool.createVO().make(...makeBaseSpriteArgs); } } //# sourceMappingURL=TexturedSpritesGeometry.js.map