/** * World Render Order * * Computes the final draw order for all entities in a scene by combining * two levels of z-index: * * 1. World-level z-index (per-character / per-object) * 2. Character-level z-index (per-body-part within a rig character) * * Sorting is hierarchical: * - Primary key: worldZIndex (character/object layer) * - Secondary key: partZIndex (body-part order within a character) * * This guarantees that a character at a higher worldZIndex renders entirely * in front of one at a lower worldZIndex. Body parts never interleave * across different world layers. */ import type { WorldEntity, WorldRenderEntry } from '../types.js'; /** * Compute the final draw order for all entities in a scene. * * Flattens entities into a single list of render entries: * - Entities with `parts` produce one entry per part. * - Entities without `parts` produce a single entry (partZIndex = 0). * * Entries are sorted ascending (lowest draws first = furthest behind): * 1. By worldZIndex * 2. By partZIndex (tiebreaker within the same world layer) * 3. By input order (stable sort for remaining ties) * * This is a pure function with no side effects. */ export declare function computeWorldRenderOrder(entities: WorldEntity[]): WorldRenderEntry[]; /** * Compute the effective z-index for a single item. * This is the sum of worldZIndex + partZIndex, useful for display purposes. * Note: sorting uses worldZIndex as primary key, not this sum. */ export declare function computeEffectiveZIndex(worldZIndex: number, partZIndex?: number): number; //# sourceMappingURL=worldOrder.d.ts.map