export type Item = { /** * - The entity placed each frame. */ entity: Entity; /** * - The pooled shape. */ shape: Shape; /** * - The color the shape was created with, updated in place. */ base: Color; /** * - The occluded color the shape was created with, updated in place. */ occluded: Color; /** * - The mesh instances of the shape, in draw order. */ meshInstances: MeshInstance[]; }; /** * @import { Entity } from '../../../framework/entity.js' * @import { MeshInstance } from '../../../scene/mesh-instance.js' * @import { Shape } from '../shape/shape.js' */ /** * @typedef {object} Item * @property {Entity} entity - The entity placed each frame. * @property {Shape} shape - The pooled shape. * @property {Color} base - The color the shape was created with, updated in place. * @property {Color} occluded - The occluded color the shape was created with, updated in place. * @property {MeshInstance[]} meshInstances - The mesh instances of the shape, in draw order. */ /** * A pool of shapes, placed in order each frame and hidden when unused. * * @augments {Pool} * @ignore */ export class ShapePool extends Pool { /** * @param {(base: Color, occluded: Color) => Shape} create - Creates a shape in the colors. * @param {Entity} parent - The parent of the shapes. * @param {number} drawOrder - The draw order the shapes are placed from in a manually sorted * layer. */ constructor(create: (base: Color, occluded: Color) => Shape, parent: Entity, drawOrder: number); /** * The draw order the shapes are placed from in a manually sorted layer. * * @type {number} */ drawOrder: number; hide(): void; destroy(): void; } import type { Entity } from '../../../framework/entity.js'; import type { Shape } from '../shape/shape.js'; import { Color } from '../../../core/math/color.js'; import type { MeshInstance } from '../../../scene/mesh-instance.js'; import { Pool } from '../pool.js';