export { c as createPolyScene } from './createPolyScene-BBjx0kRF.cjs'; import * as _layoutit_polycss_core from '@layoutit/polycss-core'; import { PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, PolyTextureLeafSizing, PolyTextureImageRendering, PolyTextureBackend, PolyTextureProjection, TextureAtlasPlan, TextureQuality, PackedAtlas, PackedPage, TextureAtlasPage, PolyRenderStrategy, SolidPaintDefaults, Polygon, SolidTriangleFrame, Vec3, BoxPolygonsOptions, ParseResult, ConePolygonsOptions, CylinderPolygonsOptions, DodecahedronPolygonsOptions, IcosahedronPolygonsOptions, OctahedronPolygonsOptions, PlanePolygonsOptions, RingPolygonsOptions, SpherePolygonsOptions, TetrahedronPolygonsOptions, TorusPolygonsOptions } from '@layoutit/polycss-core'; export * from '@layoutit/polycss-core'; export { ComputeTextureAtlasPlanOptions, PackedAtlas, PackedPage, PackedTextureAtlasEntry, PolyMeshTransformInput, PolyRenderStrategiesOption, PolyRenderStrategy, PolySceneTransformInput, ParseResult as PolyShapeResult, SolidPaintDefaults, SolidTriangleFrame, TextureAtlasPage, TextureAtlasPlan, TextureQuality, buildPolyMeshTransform, buildPolySceneTransform, buildTextureEdgeRepairSets, computeTextureAtlasPlanPublic, cssBorderShapeForPlan, cssDistanceToWorld, cssPositionToWorld, formatBorderShapeEntryMatrix, formatCssLengthPx, formatMatrix3d, formatSolidQuadEntryMatrix, isFullRectSolid, isProjectiveQuadPlan, isSolidTrianglePlan, cssDistanceToWorld as polyCssDistanceToWorld, cssPositionToWorld as polyCssPositionToWorld, worldDirectionToPolyCss, worldDirectionalLightToCss as worldDirectionalLightToPolyCss, worldDistanceToCss, worldDistanceToCss as worldDistanceToPolyCss, worldPositionToPolyCss } from '@layoutit/polycss-core'; import { P as PolySceneHandle, a as PolyMeshHandle } from './types-CfRKEj2z.cjs'; export { b as PolyCameraOptions, c as PolyMeshTransform, d as PolyOrthographicCameraHandle, e as PolyOrthographicCameraOptions, f as PolyPerspectiveCameraHandle, g as PolyPerspectiveCameraOptions, h as PolySceneOptions, i as createPolyCamera, j as createPolyOrthographicCamera, k as createPolyPerspectiveCamera } from './types-CfRKEj2z.cjs'; import { P as PolyControlsHandle, a as PolyControlsBaseOptions, b as PolyControlsEvent, c as PolyControlsListener } from './PolyShapeElements-BviHejaw.cjs'; export { d as PolyBoxElement, e as PolyCameraElement, f as PolyConeElement, g as PolyControlsAnimateOptions, h as PolyControlsCamera, i as PolyControlsChangeEvent, j as PolyControlsInteractionEvent, k as PolyCylinderElement, l as PolyDodecahedronElement, m as PolyFirstPersonControlsElement, n as PolyIcosahedronElement, o as PolyIframeElement, p as PolyMapControlsElement, q as PolyMeshElement, r as PolyOctahedronElement, s as PolyOrbitControlsElement, t as PolyOrbitControlsHandle, u as PolyOrbitControlsOptions, v as PolyOrthographicCameraElement, w as PolyPerspectiveCameraElement, x as PolyPlaneElement, y as PolyPolygonElement, z as PolyRingElement, A as PolySceneElement, B as PolySelectElement, C as PolySphereElement, D as PolyTetrahedronElement, E as PolyTorusElement, F as PolyTransformControlsElement, G as createPolyOrbitControls } from './PolyShapeElements-BviHejaw.cjs'; interface RenderTextureAtlasOptions { doc?: Document; tileSize?: number; layerElevation?: number; directionalLight?: PolyDirectionalLight; ambientLight?: PolyAmbientLight; textureLighting?: PolyTextureLightingMode; /** * Atlas bitmap budget and CSS sprite size. Numeric values are clamped to * 0.1..1 and keep the 64px sprite. Omitted / `"auto"` picks a raster scale * from packed atlas area, caps oversized runtime bitmaps by side length and * decoded-memory budget, and uses a 128px sprite on desktop-class documents * or a 64px sprite on mobile-class documents. */ textureQuality?: _layoutit_polycss_core.TextureQuality; textureLeafSizing?: PolyTextureLeafSizing; textureImageRendering?: PolyTextureImageRendering; textureBackend?: PolyTextureBackend; textureProjection?: PolyTextureProjection; solidPaintDefaults?: _layoutit_polycss_core.SolidPaintDefaults; strategies?: _layoutit_polycss_core.PolyRenderStrategiesOption; /** * Indices of polygons that the directional light cannot reach (precomputed * by createPolyScene via {@link computeLightVisibility}). Atlas + solid * planning forces directScale to 0 for these polys so they render with * ambient-only color, matching what a shadow-map pass would output. */ lightOccludedPolyIndices?: ReadonlySet; } interface RenderedPoly { polygonIndex: number; element: HTMLElement; kind?: "atlas" | "image" | "solid" | "border" | "corner" | "triangle"; plan?: _layoutit_polycss_core.TextureAtlasPlan; dispose(): void; } interface RenderTextureAtlasResult { rendered: RenderedPoly[]; dispose(): void; /** * Resolves once every textured `` leaf has its `background-image` * applied (i.e. the atlas canvas → Blob → URL chain has completed and * the apply-bg pass has run). For meshes with no textured leaves this * resolves immediately. Callers doing stale-while-revalidate swaps * await this before disposing the previous render — without it, the * fresh leaves mount with empty backgrounds and the prior frame's * bitmaps would be needed underneath to avoid a transparent flash. */ pagesReady?: Promise; } interface RenderTextureAtlasAsyncResult extends RenderTextureAtlasResult { solidPaintDefaults: _layoutit_polycss_core.SolidPaintDefaults; } declare function packTextureAtlasPlansWithScale(plans: Array, textureQualityInput: TextureQuality | undefined, doc: Document | null | undefined, textureLeafSizing?: PolyTextureLeafSizing): { packed: PackedAtlas; atlasScale: number; atlasCanonicalSize: number; }; declare function buildAtlasPages(pages: PackedPage[], textureLighting: PolyTextureLightingMode, doc: Document, atlasScale: number, isCancelled: () => boolean): Promise; /** * Compute the dominant paint defaults from an already-computed array of plans. * * React and Vue compute plans first (to drive the atlas packing), then pass * the plan array here so they don't need access to the raw polygon list. * Requires access to a Document to check browser support for solid-triangle * and border-shape strategies. */ declare function getSolidPaintDefaultsFromPlans(plans: Array, textureLighting: PolyTextureLightingMode, disabled?: ReadonlySet, doc?: Document | null): SolidPaintDefaults; /** * Returns true when the browser supports the `border-shape` CSS property and * the pointer/hover media queries indicate a fine-pointer device (desktop-class). * Falls back to a globalThis-based check when no Document is available. */ declare function isBorderShapeSupported(doc?: Document | null): boolean; /** * Returns true when the browser renders CSS border-trick triangles correctly. * WebKit/Safari renders them incorrectly when transformed — this check gates * the `` strategy path. */ declare function isSolidTriangleSupported(doc?: Document | null): boolean; /** * Filter a plan array to the subset that needs atlas packing, given the active * render strategies and texture-lighting mode. Plans excluded from the atlas * will be rendered via ``, ``, or `` by the framework components. */ declare function filterAtlasPlans(plans: Array, textureLighting: PolyTextureLightingMode, disabled: ReadonlySet, doc?: Document | null): Array; declare function getSolidPaintDefaults(polygons: Polygon[], options?: RenderTextureAtlasOptions): SolidPaintDefaults; declare function renderPolygonsWithTextureAtlas(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult; declare function renderPolygonsWithTextureAtlasAsync(polygons: Polygon[], options?: RenderTextureAtlasOptions, shouldCancel?: () => boolean): Promise; declare function updateStableTriangleFrame(rendered: RenderedPoly[], polygons: Polygon[], frame: SolidTriangleFrame, options?: RenderTextureAtlasOptions): boolean; declare function updatePolygonsWithStableTopology(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): boolean; declare function renderPolygonsWithStableTriangles(polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null; declare function updatePolygonsWithStableTriangles(rendered: RenderedPoly[], polygons: Polygon[], options?: RenderTextureAtlasOptions): RenderTextureAtlasResult | null; /** * createPolyMapControls — map/pan-mode camera input for a PolyScene. * * Left-drag pans the target (slippy-map semantics — terrain follows pointer). * Right-drag or Shift+left-drag orbits. Wheel zooms or dollies. * Mirrors Three.js MapControls semantics. * * For orbit-only semantics (left-drag orbits) use `createPolyOrbitControls` * instead. */ type PolyMapControlsOptions = PolyControlsBaseOptions; type PolyMapControlsHandle = PolyControlsHandle; declare function createPolyMapControls(scene: PolySceneHandle, options?: PolyMapControlsOptions): PolyMapControlsHandle; /** * createPolyFirstPersonControls — first-person camera input for a PolyScene. * * Mouselook on pointer-lock, WASD/arrow planar move in the yaw-aligned XY * plane, Space jump (parametric arc, no collision), Ctrl crouch. Each input * axis is independently toggleable so callers can mix-and-match (e.g. * mouselook-only on a model viewer, or move-only on a tour rail). * * For orbit semantics use `createPolyOrbitControls`. For pan/orbit map * semantics use `createPolyMapControls`. */ interface PolyFirstPersonControlsOptions { /** Master switch. When `false`, all sub-controls are inert. Default: `true`. */ enabled?: boolean; /** Pointer-lock mouselook (rotX = pitch, rotY = yaw). Default: `true`. */ lookEnabled?: boolean; /** WASD / arrow-key planar movement on world XY. Default: `true`. */ moveEnabled?: boolean; /** Space-bar parametric jump arc on world Z. Default: `true`. */ jumpEnabled?: boolean; /** Ctrl crouch (lowers eye height while held). Default: `true`. */ crouchEnabled?: boolean; /** Mouselook sensitivity in degrees per pixel. Default: `0.15`. */ lookSensitivity?: number; /** Invert vertical mouselook. Default: `false`. */ invertY?: boolean; /** Movement speed in world units per second. Default: `5`. */ moveSpeed?: number; /** Initial vertical velocity for a jump, world units per second. Default: `7`. */ jumpVelocity?: number; /** Gravity acceleration in world units per second squared. Default: `18`. */ gravity?: number; /** Standing eye height above the ground plane (target.z). Default: `1.7`. */ eyeHeight?: number; /** Eye height while crouching. Default: `1`. */ crouchHeight?: number; /** World Z of the ground plane the player walks on. Default: `0`. */ groundZ?: number; /** Min pitch (rotX) angle. Default: `5`. */ minPitch?: number; /** Max pitch (rotX) angle. Default: `175`. */ maxPitch?: number; } interface PolyFirstPersonControlsHandle { update(partial: PolyFirstPersonControlsOptions): void; resume(): void; pause(): void; destroy(): void; /** Request pointer-lock now. Call from a user gesture (click). */ lock(): void; /** Release pointer-lock. */ unlock(): void; /** Whether pointer-lock is currently held. */ isLocked(): boolean; /** * The camera's WORLD position (the eye). FPV maintains this separately * from the scene's `target` so mouselook rotates around it (in-place) * instead of orbiting around target. Snapshot — mutate via WASD / jump / * crouch, or by calling `setOrigin`. */ getOrigin(): [number, number, number]; /** * Move the camera origin to a specific world position. Re-derives the * scene's target so the perspective viewer follows. Use this to teleport, * spawn at a chosen spot, etc. */ setOrigin(origin: [number, number, number]): void; addEventListener(type: T, listener: PolyControlsListener>): void; removeEventListener(type: T, listener: PolyControlsListener>): void; hasEventListener(type: T, listener: PolyControlsListener>): boolean; } declare function createPolyFirstPersonControls(scene: PolySceneHandle, options?: PolyFirstPersonControlsOptions): PolyFirstPersonControlsHandle; /** * createSelect — additive selection layer for vanilla PolyCSS scenes. * Mirrors the React `