@layoutit/polycss-react 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +148 -123
- package/dist/index.cjs +2802 -1831
- package/dist/index.d.cts +100 -28
- package/dist/index.d.ts +100 -28
- package/dist/index.js +2747 -1723
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties, MouseEventHandler, PointerEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, MouseEvent as MouseEvent$1 } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { Vec3, CameraState, CameraHandle, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, Polygon, PolyAmbientLight, LoadMeshOptions, PolyAnimationTarget, PolyAnimationMixer, PolyAnimationClip, PolyAnimationAction, ParseAnimationController } from '@layoutit/polycss-core';
|
|
5
|
-
export {
|
|
4
|
+
import { Vec3, CameraState, CameraHandle, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, TextureQuality, Polygon, PolyAmbientLight, PolySeamBleed, PolyRenderStrategiesOption, LoadMeshOptions, ParseResult, MeshResolution, BoxPolygonsOptions, ConePolygonsOptions, CylinderPolygonsOptions, DodecahedronPolygonsOptions, IcosahedronPolygonsOptions, OctahedronPolygonsOptions, PlanePolygonsOptions, RingPolygonsOptions, SpherePolygonsOptions, TetrahedronPolygonsOptions, TorusPolygonsOptions, PolyAnimationTarget, PolyAnimationMixer, PolyAnimationClip, PolyAnimationAction, ParseAnimationController } from '@layoutit/polycss-core';
|
|
5
|
+
export { ArrowPolygonsOptions, AutoRotateConfig, AutoRotateOption, AxesHelperOptions, BASE_TILE, BoxFace, BoxFaceOptions, BoxPolygonsOptions, CAMERA_BACKFACE_CULL_EPS, CameraCullNormalGroup, CameraCullRotation, CameraHandle, CameraState, CameraStyleInput, ConePolygonsOptions, CoverPlanarPolygonsOptions, CullInteriorOptions, CylinderPolygonsOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, DEFAULT_SEAM_FACET_SPLIT_OPTIONS, DEFAULT_SEAM_OVERLAP_OPTIONS, DodecahedronPolygonsOptions, GltfParseOptions, IcosahedronPolygonsOptions, LoadMeshOptions, LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MeshResolution, MtlParseResult, NormalizeResult, ObjParseOptions, OctahedronPolygonsOptions, OptimizeAnimatedMeshPolygonsOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyRenderStrategiesOption, PolyRenderStrategy, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SolidTextureSampleOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, conePolygons, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cullInteriorPolygons, cylinderPolygons, dodecahedronPolygons, formatColor, icosahedronPolygons, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeAnimatedMeshPolygons, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, planePolygons, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, repairMeshSeams, ringPolygons, rotateVec3, seamFacetSplitPolygons, seamFacetSplitReport, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, tetrahedronPolygons, torusPolygons } from '@layoutit/polycss-core';
|
|
6
6
|
|
|
7
7
|
interface PolyPerspectiveCameraProps {
|
|
8
8
|
zoom?: number;
|
|
@@ -18,7 +18,7 @@ interface PolyPerspectiveCameraProps {
|
|
|
18
18
|
style?: React.CSSProperties;
|
|
19
19
|
}
|
|
20
20
|
declare function PolyPerspectiveCameraInner({ zoom, target, rotX, rotY, distance, perspective, children, className, style, }: PolyPerspectiveCameraProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
declare const PolyPerspectiveCamera:
|
|
21
|
+
declare const PolyPerspectiveCamera: React$1.MemoExoticComponent<typeof PolyPerspectiveCameraInner>;
|
|
22
22
|
|
|
23
23
|
interface PolyOrthographicCameraProps {
|
|
24
24
|
zoom?: number;
|
|
@@ -32,7 +32,7 @@ interface PolyOrthographicCameraProps {
|
|
|
32
32
|
style?: React.CSSProperties;
|
|
33
33
|
}
|
|
34
34
|
declare function PolyOrthographicCameraInner({ zoom, target, rotX, rotY, distance, children, className, style, }: PolyOrthographicCameraProps): react_jsx_runtime.JSX.Element;
|
|
35
|
-
declare const PolyOrthographicCamera:
|
|
35
|
+
declare const PolyOrthographicCamera: React$1.MemoExoticComponent<typeof PolyOrthographicCameraInner>;
|
|
36
36
|
|
|
37
37
|
interface SceneStoreState {
|
|
38
38
|
cameraState: CameraState;
|
|
@@ -101,25 +101,22 @@ interface PolyCameraContextValue {
|
|
|
101
101
|
*/
|
|
102
102
|
applyTransformDirect: () => void;
|
|
103
103
|
}
|
|
104
|
-
declare const PolyCameraContext:
|
|
104
|
+
declare const PolyCameraContext: React$1.Context<PolyCameraContextValue | null>;
|
|
105
105
|
declare function useCameraContext(): PolyCameraContextValue;
|
|
106
106
|
|
|
107
107
|
interface ShadowOptions {
|
|
108
108
|
color?: string;
|
|
109
109
|
opacity?: number;
|
|
110
110
|
lift?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Maximum CSS pixels the shadow may extend beyond the mesh's
|
|
113
|
+
* footprint. Caps the SVG backing store at low light elevations to
|
|
114
|
+
* prevent repaint flicker. Default: `2000`. Pass `Infinity` to
|
|
115
|
+
* disable the cap entirely.
|
|
116
|
+
*/
|
|
117
|
+
maxExtend?: number;
|
|
111
118
|
}
|
|
112
119
|
|
|
113
|
-
/** A render strategy tag that can be selectively disabled. */
|
|
114
|
-
type PolyRenderStrategy = "b" | "i" | "u";
|
|
115
|
-
interface PolyRenderStrategiesOption {
|
|
116
|
-
/** Strategies to skip; polygons that would normally use them fall through
|
|
117
|
-
* the chain (b → i → s, u → i → s, i → s). `<s>` is the universal
|
|
118
|
-
* fallback and cannot be disabled — textured polys have no other path. */
|
|
119
|
-
disable?: readonly PolyRenderStrategy[];
|
|
120
|
-
}
|
|
121
|
-
type TextureQuality = number | "auto";
|
|
122
|
-
|
|
123
120
|
/**
|
|
124
121
|
* Three.js-style transform props accepted by every polycss component.
|
|
125
122
|
* In Phase 3, position/scale/rotation are accepted but not yet applied —
|
|
@@ -225,6 +222,8 @@ interface PolySceneProps extends TransformProps {
|
|
|
225
222
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
226
223
|
* raster scale and the 64px sprite. */
|
|
227
224
|
textureQuality?: TextureQuality;
|
|
225
|
+
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
226
|
+
seamBleed?: PolySeamBleed;
|
|
228
227
|
/**
|
|
229
228
|
* Render strategy overrides. Use `{ disable: ["u"] }` to force solid
|
|
230
229
|
* triangles through the atlas path (`<s>`), or `{ disable: ["b", "i", "u"] }`
|
|
@@ -243,9 +242,11 @@ interface PolySceneProps extends TransformProps {
|
|
|
243
242
|
*/
|
|
244
243
|
autoCenter?: boolean;
|
|
245
244
|
/**
|
|
246
|
-
* Shadow appearance for meshes with `castShadow={true}`.
|
|
247
|
-
*
|
|
248
|
-
*
|
|
245
|
+
* Shadow appearance for meshes with `castShadow={true}`. Works in both
|
|
246
|
+
* lighting modes — dynamic mode projects via CSS vars so shadows
|
|
247
|
+
* follow a moving light, baked mode CPU-bakes the projection into
|
|
248
|
+
* each leaf's inline `matrix3d` and drops back-facing polys from the
|
|
249
|
+
* DOM entirely. Defaults: `{ color: "#000000", opacity: 0.25, lift: 0.05, maxExtend: 2000 }`.
|
|
249
250
|
*/
|
|
250
251
|
shadow?: ShadowOptions;
|
|
251
252
|
className?: string;
|
|
@@ -254,12 +255,13 @@ interface PolySceneProps extends TransformProps {
|
|
|
254
255
|
debugShowLabels?: boolean;
|
|
255
256
|
debugShowBackfaces?: boolean;
|
|
256
257
|
}
|
|
257
|
-
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
258
|
-
declare const PolyScene:
|
|
258
|
+
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, seamBleed, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
declare const PolyScene: React$1.MemoExoticComponent<typeof PolySceneInner>;
|
|
259
260
|
|
|
260
261
|
type UseMeshOptions = LoadMeshOptions;
|
|
261
262
|
interface UseMeshResult {
|
|
262
263
|
polygons: Polygon[];
|
|
264
|
+
voxelSource: ParseResult["voxelSource"];
|
|
263
265
|
loading: boolean;
|
|
264
266
|
error: Error | null;
|
|
265
267
|
warnings: string[];
|
|
@@ -271,7 +273,7 @@ declare function usePolyMesh(src: string, options?: UseMeshOptions): UseMeshResu
|
|
|
271
273
|
/**
|
|
272
274
|
* Pointer event API for <PolyMesh>. Mirrors @react-three/fiber's mesh
|
|
273
275
|
* event surface (handler names + payload shape) so devs migrating from
|
|
274
|
-
* three.js use the same mental model.
|
|
276
|
+
* three.js use the same mental model. PolyCSS is DOM-native so we get
|
|
275
277
|
* native pointer events for free — no raycaster, no canvas event
|
|
276
278
|
* synthesis.
|
|
277
279
|
*
|
|
@@ -306,6 +308,12 @@ interface PolyMeshHandle {
|
|
|
306
308
|
getScale(): number | Vec3 | undefined;
|
|
307
309
|
/** Polygons currently being rendered (post-autoCenter). */
|
|
308
310
|
getPolygons(): Polygon[];
|
|
311
|
+
/**
|
|
312
|
+
* Replace the mesh polygons imperatively. Animated solid-triangle meshes use
|
|
313
|
+
* a stable DOM update path that mutates mounted leaves directly; unsupported
|
|
314
|
+
* topology falls back to the normal framework render path.
|
|
315
|
+
*/
|
|
316
|
+
setPolygons(polygons: Polygon[]): void;
|
|
309
317
|
/**
|
|
310
318
|
* Snapshot the current `rotation` prop as the new "baked rotation" and
|
|
311
319
|
* trigger an atlas re-rasterization with the directional light
|
|
@@ -427,6 +435,8 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
427
435
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
428
436
|
* raster scale and the 64px sprite. */
|
|
429
437
|
textureQuality?: TextureQuality;
|
|
438
|
+
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
439
|
+
seamBleed?: PolySeamBleed;
|
|
430
440
|
/** Per-polygon override render, or static children mounted inside the mesh wrapper. */
|
|
431
441
|
children?: ((polygon: Polygon, index: number) => ReactNode) | ReactNode;
|
|
432
442
|
/** Loading slot — rendered while `src` is being fetched/parsed. */
|
|
@@ -435,6 +445,10 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
435
445
|
errorFallback?: (error: Error) => ReactNode;
|
|
436
446
|
/** Parser options forwarded to parseObj/parseGltf. */
|
|
437
447
|
parseOptions?: UseMeshOptions;
|
|
448
|
+
/** Mesh optimization intent. Defaults to "lossy"; set "lossless" to keep
|
|
449
|
+
* authored surface fidelity. Top-level prop wins over `parseOptions.meshResolution`
|
|
450
|
+
* when both are present. */
|
|
451
|
+
meshResolution?: MeshResolution;
|
|
438
452
|
/**
|
|
439
453
|
* When `true` and the scene is in dynamic lighting mode, emits a flat
|
|
440
454
|
* shadow leaf (`<q class="polycss-shadow">`) sibling for each polygon.
|
|
@@ -446,7 +460,7 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
446
460
|
className?: string;
|
|
447
461
|
style?: CSSProperties;
|
|
448
462
|
}
|
|
449
|
-
declare const PolyMesh:
|
|
463
|
+
declare const PolyMesh: React$1.ForwardRefExoticComponent<PolyMeshProps & React$1.RefAttributes<PolyMeshHandle>>;
|
|
450
464
|
|
|
451
465
|
interface PolyGroundProps {
|
|
452
466
|
/** Side length of the ground quad in world units. Default `6`. */
|
|
@@ -473,7 +487,7 @@ interface UseSceneContextResult {
|
|
|
473
487
|
};
|
|
474
488
|
}
|
|
475
489
|
/**
|
|
476
|
-
* React hook that runs the
|
|
490
|
+
* React hook that runs the PolyCSS scene-context pipeline:
|
|
477
491
|
* normalizePolygons → mergePolygons by default → bbox compute.
|
|
478
492
|
*
|
|
479
493
|
* Returns the processed polygons + the scene-wide axis-aligned bbox. Memoized
|
|
@@ -510,7 +524,42 @@ declare function usePolyMaterial(options: {
|
|
|
510
524
|
* typically created once at parse time and passed by reference.
|
|
511
525
|
*/
|
|
512
526
|
declare function PolyInner({ vertices, color, texture, uvs, data, material, position, scale, rotation, className, style: styleProp, id, onClick, onDoubleClick, onMouseEnter, onMouseLeave, onMouseMove, onPointerDown, onPointerUp, onPointerEnter, onPointerLeave, onFocus, onBlur, onKeyDown, tabIndex, role, "aria-label": ariaLabel, "aria-hidden": ariaHidden, pointerEvents: pointerEventsProp, context, textureLighting: textureLightingProp, textureQuality: textureQualityProp, baseColor: baseColorProp, ...dataAttrs }: PolyProps): react_jsx_runtime.JSX.Element | null;
|
|
513
|
-
declare const Poly:
|
|
527
|
+
declare const Poly: React__default.MemoExoticComponent<typeof PolyInner>;
|
|
528
|
+
|
|
529
|
+
type ShapeMeshProps = Omit<PolyMeshProps, "polygons" | "src" | "mtl">;
|
|
530
|
+
interface PolyBoxProps extends ShapeMeshProps, BoxPolygonsOptions {
|
|
531
|
+
}
|
|
532
|
+
declare function PolyBox({ size, center, min, max, color, texture, material, uvs, data, faces, ...meshProps }: PolyBoxProps): react_jsx_runtime.JSX.Element;
|
|
533
|
+
interface PolyPlaneProps extends ShapeMeshProps, PlanePolygonsOptions {
|
|
534
|
+
}
|
|
535
|
+
declare function PolyPlane({ axis, size, offset, along, color, ...meshProps }: PolyPlaneProps): react_jsx_runtime.JSX.Element;
|
|
536
|
+
interface PolyRingProps extends ShapeMeshProps, RingPolygonsOptions {
|
|
537
|
+
}
|
|
538
|
+
declare function PolyRing({ axis, radius, halfThickness, segments, color, ...meshProps }: PolyRingProps): react_jsx_runtime.JSX.Element;
|
|
539
|
+
interface PolyOctahedronProps extends ShapeMeshProps, OctahedronPolygonsOptions {
|
|
540
|
+
}
|
|
541
|
+
declare function PolyOctahedron({ center, size, color, ...meshProps }: PolyOctahedronProps): react_jsx_runtime.JSX.Element;
|
|
542
|
+
interface PolyTetrahedronProps extends ShapeMeshProps, TetrahedronPolygonsOptions {
|
|
543
|
+
}
|
|
544
|
+
declare function PolyTetrahedron({ size, color, ...meshProps }: PolyTetrahedronProps): react_jsx_runtime.JSX.Element;
|
|
545
|
+
interface PolyIcosahedronProps extends ShapeMeshProps, IcosahedronPolygonsOptions {
|
|
546
|
+
}
|
|
547
|
+
declare function PolyIcosahedron({ size, color, ...meshProps }: PolyIcosahedronProps): react_jsx_runtime.JSX.Element;
|
|
548
|
+
interface PolyDodecahedronProps extends ShapeMeshProps, DodecahedronPolygonsOptions {
|
|
549
|
+
}
|
|
550
|
+
declare function PolyDodecahedron({ size, color, ...meshProps }: PolyDodecahedronProps): react_jsx_runtime.JSX.Element;
|
|
551
|
+
interface PolySphereProps extends ShapeMeshProps, SpherePolygonsOptions {
|
|
552
|
+
}
|
|
553
|
+
declare function PolySphere({ radius, subdivisions, color, ...meshProps }: PolySphereProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
interface PolyCylinderProps extends ShapeMeshProps, CylinderPolygonsOptions {
|
|
555
|
+
}
|
|
556
|
+
declare function PolyCylinder({ radius, radiusTop, height, radialSegments, color, ...meshProps }: PolyCylinderProps): react_jsx_runtime.JSX.Element;
|
|
557
|
+
interface PolyConeProps extends ShapeMeshProps, ConePolygonsOptions {
|
|
558
|
+
}
|
|
559
|
+
declare function PolyCone({ radius, height, radialSegments, color, ...meshProps }: PolyConeProps): react_jsx_runtime.JSX.Element;
|
|
560
|
+
interface PolyTorusProps extends ShapeMeshProps, TorusPolygonsOptions {
|
|
561
|
+
}
|
|
562
|
+
declare function PolyTorus({ radius, tube, radialSegments, tubularSegments, color, ...meshProps }: PolyTorusProps): react_jsx_runtime.JSX.Element;
|
|
514
563
|
|
|
515
564
|
interface PolyFirstPersonControlsOptions {
|
|
516
565
|
/** Master switch. When `false`, all sub-controls are inert. Default: `true`. */
|
|
@@ -577,7 +626,7 @@ interface PolyFirstPersonControlsProps extends PolyFirstPersonControlsOptions {
|
|
|
577
626
|
/** Called when pointer-lock is released (interaction ends). */
|
|
578
627
|
onInteractionEnd?: () => void;
|
|
579
628
|
}
|
|
580
|
-
declare const PolyFirstPersonControls:
|
|
629
|
+
declare const PolyFirstPersonControls: React$1.ForwardRefExoticComponent<PolyFirstPersonControlsProps & React$1.RefAttributes<PolyFirstPersonControlsHandle>>;
|
|
581
630
|
|
|
582
631
|
interface PolyControlsAnimateOptions {
|
|
583
632
|
/** Degrees per 60Hz-equivalent frame. Default 0.3 (≈ 18 deg/sec). */
|
|
@@ -789,6 +838,29 @@ declare function PolyDirectionalLightHelper({ light, target, distance, size, col
|
|
|
789
838
|
|
|
790
839
|
declare function injectPolyBaseStyles(doc?: Document): void;
|
|
791
840
|
|
|
841
|
+
interface PolyRenderSurfaceLeafCounts {
|
|
842
|
+
quad: number;
|
|
843
|
+
clippedSolid: number;
|
|
844
|
+
atlas: number;
|
|
845
|
+
stableTriangle: number;
|
|
846
|
+
}
|
|
847
|
+
interface PolyRenderStats {
|
|
848
|
+
polygonCount: number;
|
|
849
|
+
mountedPolygonLeafCount: number;
|
|
850
|
+
shadowLeafCount: number;
|
|
851
|
+
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
852
|
+
bucketCount: number;
|
|
853
|
+
}
|
|
854
|
+
interface PolyRenderStatsOptions {
|
|
855
|
+
polygonCount?: number;
|
|
856
|
+
/**
|
|
857
|
+
* Optional subtree selector for diagnostics that only want model leaves and
|
|
858
|
+
* not helpers/floors/gizmos sharing the same scene root.
|
|
859
|
+
*/
|
|
860
|
+
scopeSelector?: string;
|
|
861
|
+
}
|
|
862
|
+
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
863
|
+
|
|
792
864
|
interface UsePolyAnimationResult {
|
|
793
865
|
/** Attach to a `PolyAnimationTarget`-compatible handle when not using `root`. */
|
|
794
866
|
ref: RefObject<PolyAnimationTarget | null>;
|
|
@@ -807,4 +879,4 @@ interface UsePolyAnimationResult {
|
|
|
807
879
|
}
|
|
808
880
|
declare function usePolyAnimation(clips: PolyAnimationClip[] | undefined, controller: ParseAnimationController | undefined, root?: RefObject<PolyAnimationTarget | null> | PolyAnimationTarget | null): UsePolyAnimationResult;
|
|
809
881
|
|
|
810
|
-
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps,
|
|
882
|
+
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyBox, type PolyBoxProps, PolyOrthographicCamera as PolyCamera, PolyCameraContext, type PolyCameraContextValue, type PolyOrthographicCameraProps as PolyCameraProps, PolyCone, type PolyConeProps, type PolyControlsAnimateOptions, type PolyControlsCamera, PolyCylinder, type PolyCylinderProps, PolyDirectionalLightHelper, type PolyDirectionalLightHelperProps, PolyDodecahedron, type PolyDodecahedronProps, type PolyEventHandler, PolyFirstPersonControls, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyFirstPersonControlsProps, PolyGround, type PolyGroundProps, PolyIcosahedron, type PolyIcosahedronProps, PolyMapControls, type PolyControlsCamera as PolyMapControlsCamera, type PolyMapControlsProps, PolyMesh, type PolyMeshHandle, type PolyMeshProps, type PolyMouseEvent, PolyOctahedron, type PolyOctahedronProps, PolyOrbitControls, type PolyControlsCamera as PolyOrbitControlsCamera, type PolyOrbitControlsProps, PolyOrthographicCamera, type PolyOrthographicCameraProps, PolyPerspectiveCamera, type PolyPerspectiveCameraProps, PolyPlane, type PolyPlaneProps, type PolyPointerEvent, type PolyProps, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolyRing, type PolyRingProps, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, PolySphere, type PolySphereProps, PolyTetrahedron, type PolyTetrahedronProps, PolyTorus, type PolyTorusProps, PolyTransformControls, type PolyTransformControlsObject, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsProps, type PolyWheelEvent, type SharedControlsProps, type TransformProps, type UseCameraOptions, type UseCameraResult, type UseMeshOptions, type UseMeshResult, type UsePolyAnimationResult, type UseSceneContextOptions, type UseSceneContextResult, collectPolyRenderStats, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, useCameraContext, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
import React__default, { ReactNode, CSSProperties, MouseEventHandler, PointerEventHandler, FocusEventHandler, KeyboardEventHandler, RefObject, MouseEvent as MouseEvent$1 } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
-
import { Vec3, CameraState, CameraHandle, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, Polygon, PolyAmbientLight, LoadMeshOptions, PolyAnimationTarget, PolyAnimationMixer, PolyAnimationClip, PolyAnimationAction, ParseAnimationController } from '@layoutit/polycss-core';
|
|
5
|
-
export {
|
|
4
|
+
import { Vec3, CameraState, CameraHandle, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, TextureQuality, Polygon, PolyAmbientLight, PolySeamBleed, PolyRenderStrategiesOption, LoadMeshOptions, ParseResult, MeshResolution, BoxPolygonsOptions, ConePolygonsOptions, CylinderPolygonsOptions, DodecahedronPolygonsOptions, IcosahedronPolygonsOptions, OctahedronPolygonsOptions, PlanePolygonsOptions, RingPolygonsOptions, SpherePolygonsOptions, TetrahedronPolygonsOptions, TorusPolygonsOptions, PolyAnimationTarget, PolyAnimationMixer, PolyAnimationClip, PolyAnimationAction, ParseAnimationController } from '@layoutit/polycss-core';
|
|
5
|
+
export { ArrowPolygonsOptions, AutoRotateConfig, AutoRotateOption, AxesHelperOptions, BASE_TILE, BoxFace, BoxFaceOptions, BoxPolygonsOptions, CAMERA_BACKFACE_CULL_EPS, CameraCullNormalGroup, CameraCullRotation, CameraHandle, CameraState, CameraStyleInput, ConePolygonsOptions, CoverPlanarPolygonsOptions, CullInteriorOptions, CylinderPolygonsOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, DEFAULT_SEAM_FACET_SPLIT_OPTIONS, DEFAULT_SEAM_OVERLAP_OPTIONS, DodecahedronPolygonsOptions, GltfParseOptions, IcosahedronPolygonsOptions, LoadMeshOptions, LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MeshResolution, MtlParseResult, NormalizeResult, ObjParseOptions, OctahedronPolygonsOptions, OptimizeAnimatedMeshPolygonsOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyRenderStrategiesOption, PolyRenderStrategy, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SolidTextureSampleOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, conePolygons, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cullInteriorPolygons, cylinderPolygons, dodecahedronPolygons, formatColor, icosahedronPolygons, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeAnimatedMeshPolygons, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, planePolygons, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, repairMeshSeams, ringPolygons, rotateVec3, seamFacetSplitPolygons, seamFacetSplitReport, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, tetrahedronPolygons, torusPolygons } from '@layoutit/polycss-core';
|
|
6
6
|
|
|
7
7
|
interface PolyPerspectiveCameraProps {
|
|
8
8
|
zoom?: number;
|
|
@@ -18,7 +18,7 @@ interface PolyPerspectiveCameraProps {
|
|
|
18
18
|
style?: React.CSSProperties;
|
|
19
19
|
}
|
|
20
20
|
declare function PolyPerspectiveCameraInner({ zoom, target, rotX, rotY, distance, perspective, children, className, style, }: PolyPerspectiveCameraProps): react_jsx_runtime.JSX.Element;
|
|
21
|
-
declare const PolyPerspectiveCamera:
|
|
21
|
+
declare const PolyPerspectiveCamera: React$1.MemoExoticComponent<typeof PolyPerspectiveCameraInner>;
|
|
22
22
|
|
|
23
23
|
interface PolyOrthographicCameraProps {
|
|
24
24
|
zoom?: number;
|
|
@@ -32,7 +32,7 @@ interface PolyOrthographicCameraProps {
|
|
|
32
32
|
style?: React.CSSProperties;
|
|
33
33
|
}
|
|
34
34
|
declare function PolyOrthographicCameraInner({ zoom, target, rotX, rotY, distance, children, className, style, }: PolyOrthographicCameraProps): react_jsx_runtime.JSX.Element;
|
|
35
|
-
declare const PolyOrthographicCamera:
|
|
35
|
+
declare const PolyOrthographicCamera: React$1.MemoExoticComponent<typeof PolyOrthographicCameraInner>;
|
|
36
36
|
|
|
37
37
|
interface SceneStoreState {
|
|
38
38
|
cameraState: CameraState;
|
|
@@ -101,25 +101,22 @@ interface PolyCameraContextValue {
|
|
|
101
101
|
*/
|
|
102
102
|
applyTransformDirect: () => void;
|
|
103
103
|
}
|
|
104
|
-
declare const PolyCameraContext:
|
|
104
|
+
declare const PolyCameraContext: React$1.Context<PolyCameraContextValue | null>;
|
|
105
105
|
declare function useCameraContext(): PolyCameraContextValue;
|
|
106
106
|
|
|
107
107
|
interface ShadowOptions {
|
|
108
108
|
color?: string;
|
|
109
109
|
opacity?: number;
|
|
110
110
|
lift?: number;
|
|
111
|
+
/**
|
|
112
|
+
* Maximum CSS pixels the shadow may extend beyond the mesh's
|
|
113
|
+
* footprint. Caps the SVG backing store at low light elevations to
|
|
114
|
+
* prevent repaint flicker. Default: `2000`. Pass `Infinity` to
|
|
115
|
+
* disable the cap entirely.
|
|
116
|
+
*/
|
|
117
|
+
maxExtend?: number;
|
|
111
118
|
}
|
|
112
119
|
|
|
113
|
-
/** A render strategy tag that can be selectively disabled. */
|
|
114
|
-
type PolyRenderStrategy = "b" | "i" | "u";
|
|
115
|
-
interface PolyRenderStrategiesOption {
|
|
116
|
-
/** Strategies to skip; polygons that would normally use them fall through
|
|
117
|
-
* the chain (b → i → s, u → i → s, i → s). `<s>` is the universal
|
|
118
|
-
* fallback and cannot be disabled — textured polys have no other path. */
|
|
119
|
-
disable?: readonly PolyRenderStrategy[];
|
|
120
|
-
}
|
|
121
|
-
type TextureQuality = number | "auto";
|
|
122
|
-
|
|
123
120
|
/**
|
|
124
121
|
* Three.js-style transform props accepted by every polycss component.
|
|
125
122
|
* In Phase 3, position/scale/rotation are accepted but not yet applied —
|
|
@@ -225,6 +222,8 @@ interface PolySceneProps extends TransformProps {
|
|
|
225
222
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
226
223
|
* raster scale and the 64px sprite. */
|
|
227
224
|
textureQuality?: TextureQuality;
|
|
225
|
+
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
226
|
+
seamBleed?: PolySeamBleed;
|
|
228
227
|
/**
|
|
229
228
|
* Render strategy overrides. Use `{ disable: ["u"] }` to force solid
|
|
230
229
|
* triangles through the atlas path (`<s>`), or `{ disable: ["b", "i", "u"] }`
|
|
@@ -243,9 +242,11 @@ interface PolySceneProps extends TransformProps {
|
|
|
243
242
|
*/
|
|
244
243
|
autoCenter?: boolean;
|
|
245
244
|
/**
|
|
246
|
-
* Shadow appearance for meshes with `castShadow={true}`.
|
|
247
|
-
*
|
|
248
|
-
*
|
|
245
|
+
* Shadow appearance for meshes with `castShadow={true}`. Works in both
|
|
246
|
+
* lighting modes — dynamic mode projects via CSS vars so shadows
|
|
247
|
+
* follow a moving light, baked mode CPU-bakes the projection into
|
|
248
|
+
* each leaf's inline `matrix3d` and drops back-facing polys from the
|
|
249
|
+
* DOM entirely. Defaults: `{ color: "#000000", opacity: 0.25, lift: 0.05, maxExtend: 2000 }`.
|
|
249
250
|
*/
|
|
250
251
|
shadow?: ShadowOptions;
|
|
251
252
|
className?: string;
|
|
@@ -254,12 +255,13 @@ interface PolySceneProps extends TransformProps {
|
|
|
254
255
|
debugShowLabels?: boolean;
|
|
255
256
|
debugShowBackfaces?: boolean;
|
|
256
257
|
}
|
|
257
|
-
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
258
|
-
declare const PolyScene:
|
|
258
|
+
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, seamBleed, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
259
|
+
declare const PolyScene: React$1.MemoExoticComponent<typeof PolySceneInner>;
|
|
259
260
|
|
|
260
261
|
type UseMeshOptions = LoadMeshOptions;
|
|
261
262
|
interface UseMeshResult {
|
|
262
263
|
polygons: Polygon[];
|
|
264
|
+
voxelSource: ParseResult["voxelSource"];
|
|
263
265
|
loading: boolean;
|
|
264
266
|
error: Error | null;
|
|
265
267
|
warnings: string[];
|
|
@@ -271,7 +273,7 @@ declare function usePolyMesh(src: string, options?: UseMeshOptions): UseMeshResu
|
|
|
271
273
|
/**
|
|
272
274
|
* Pointer event API for <PolyMesh>. Mirrors @react-three/fiber's mesh
|
|
273
275
|
* event surface (handler names + payload shape) so devs migrating from
|
|
274
|
-
* three.js use the same mental model.
|
|
276
|
+
* three.js use the same mental model. PolyCSS is DOM-native so we get
|
|
275
277
|
* native pointer events for free — no raycaster, no canvas event
|
|
276
278
|
* synthesis.
|
|
277
279
|
*
|
|
@@ -306,6 +308,12 @@ interface PolyMeshHandle {
|
|
|
306
308
|
getScale(): number | Vec3 | undefined;
|
|
307
309
|
/** Polygons currently being rendered (post-autoCenter). */
|
|
308
310
|
getPolygons(): Polygon[];
|
|
311
|
+
/**
|
|
312
|
+
* Replace the mesh polygons imperatively. Animated solid-triangle meshes use
|
|
313
|
+
* a stable DOM update path that mutates mounted leaves directly; unsupported
|
|
314
|
+
* topology falls back to the normal framework render path.
|
|
315
|
+
*/
|
|
316
|
+
setPolygons(polygons: Polygon[]): void;
|
|
309
317
|
/**
|
|
310
318
|
* Snapshot the current `rotation` prop as the new "baked rotation" and
|
|
311
319
|
* trigger an atlas re-rasterization with the directional light
|
|
@@ -427,6 +435,8 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
427
435
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
428
436
|
* raster scale and the 64px sprite. */
|
|
429
437
|
textureQuality?: TextureQuality;
|
|
438
|
+
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
439
|
+
seamBleed?: PolySeamBleed;
|
|
430
440
|
/** Per-polygon override render, or static children mounted inside the mesh wrapper. */
|
|
431
441
|
children?: ((polygon: Polygon, index: number) => ReactNode) | ReactNode;
|
|
432
442
|
/** Loading slot — rendered while `src` is being fetched/parsed. */
|
|
@@ -435,6 +445,10 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
435
445
|
errorFallback?: (error: Error) => ReactNode;
|
|
436
446
|
/** Parser options forwarded to parseObj/parseGltf. */
|
|
437
447
|
parseOptions?: UseMeshOptions;
|
|
448
|
+
/** Mesh optimization intent. Defaults to "lossy"; set "lossless" to keep
|
|
449
|
+
* authored surface fidelity. Top-level prop wins over `parseOptions.meshResolution`
|
|
450
|
+
* when both are present. */
|
|
451
|
+
meshResolution?: MeshResolution;
|
|
438
452
|
/**
|
|
439
453
|
* When `true` and the scene is in dynamic lighting mode, emits a flat
|
|
440
454
|
* shadow leaf (`<q class="polycss-shadow">`) sibling for each polygon.
|
|
@@ -446,7 +460,7 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
446
460
|
className?: string;
|
|
447
461
|
style?: CSSProperties;
|
|
448
462
|
}
|
|
449
|
-
declare const PolyMesh:
|
|
463
|
+
declare const PolyMesh: React$1.ForwardRefExoticComponent<PolyMeshProps & React$1.RefAttributes<PolyMeshHandle>>;
|
|
450
464
|
|
|
451
465
|
interface PolyGroundProps {
|
|
452
466
|
/** Side length of the ground quad in world units. Default `6`. */
|
|
@@ -473,7 +487,7 @@ interface UseSceneContextResult {
|
|
|
473
487
|
};
|
|
474
488
|
}
|
|
475
489
|
/**
|
|
476
|
-
* React hook that runs the
|
|
490
|
+
* React hook that runs the PolyCSS scene-context pipeline:
|
|
477
491
|
* normalizePolygons → mergePolygons by default → bbox compute.
|
|
478
492
|
*
|
|
479
493
|
* Returns the processed polygons + the scene-wide axis-aligned bbox. Memoized
|
|
@@ -510,7 +524,42 @@ declare function usePolyMaterial(options: {
|
|
|
510
524
|
* typically created once at parse time and passed by reference.
|
|
511
525
|
*/
|
|
512
526
|
declare function PolyInner({ vertices, color, texture, uvs, data, material, position, scale, rotation, className, style: styleProp, id, onClick, onDoubleClick, onMouseEnter, onMouseLeave, onMouseMove, onPointerDown, onPointerUp, onPointerEnter, onPointerLeave, onFocus, onBlur, onKeyDown, tabIndex, role, "aria-label": ariaLabel, "aria-hidden": ariaHidden, pointerEvents: pointerEventsProp, context, textureLighting: textureLightingProp, textureQuality: textureQualityProp, baseColor: baseColorProp, ...dataAttrs }: PolyProps): react_jsx_runtime.JSX.Element | null;
|
|
513
|
-
declare const Poly:
|
|
527
|
+
declare const Poly: React__default.MemoExoticComponent<typeof PolyInner>;
|
|
528
|
+
|
|
529
|
+
type ShapeMeshProps = Omit<PolyMeshProps, "polygons" | "src" | "mtl">;
|
|
530
|
+
interface PolyBoxProps extends ShapeMeshProps, BoxPolygonsOptions {
|
|
531
|
+
}
|
|
532
|
+
declare function PolyBox({ size, center, min, max, color, texture, material, uvs, data, faces, ...meshProps }: PolyBoxProps): react_jsx_runtime.JSX.Element;
|
|
533
|
+
interface PolyPlaneProps extends ShapeMeshProps, PlanePolygonsOptions {
|
|
534
|
+
}
|
|
535
|
+
declare function PolyPlane({ axis, size, offset, along, color, ...meshProps }: PolyPlaneProps): react_jsx_runtime.JSX.Element;
|
|
536
|
+
interface PolyRingProps extends ShapeMeshProps, RingPolygonsOptions {
|
|
537
|
+
}
|
|
538
|
+
declare function PolyRing({ axis, radius, halfThickness, segments, color, ...meshProps }: PolyRingProps): react_jsx_runtime.JSX.Element;
|
|
539
|
+
interface PolyOctahedronProps extends ShapeMeshProps, OctahedronPolygonsOptions {
|
|
540
|
+
}
|
|
541
|
+
declare function PolyOctahedron({ center, size, color, ...meshProps }: PolyOctahedronProps): react_jsx_runtime.JSX.Element;
|
|
542
|
+
interface PolyTetrahedronProps extends ShapeMeshProps, TetrahedronPolygonsOptions {
|
|
543
|
+
}
|
|
544
|
+
declare function PolyTetrahedron({ size, color, ...meshProps }: PolyTetrahedronProps): react_jsx_runtime.JSX.Element;
|
|
545
|
+
interface PolyIcosahedronProps extends ShapeMeshProps, IcosahedronPolygonsOptions {
|
|
546
|
+
}
|
|
547
|
+
declare function PolyIcosahedron({ size, color, ...meshProps }: PolyIcosahedronProps): react_jsx_runtime.JSX.Element;
|
|
548
|
+
interface PolyDodecahedronProps extends ShapeMeshProps, DodecahedronPolygonsOptions {
|
|
549
|
+
}
|
|
550
|
+
declare function PolyDodecahedron({ size, color, ...meshProps }: PolyDodecahedronProps): react_jsx_runtime.JSX.Element;
|
|
551
|
+
interface PolySphereProps extends ShapeMeshProps, SpherePolygonsOptions {
|
|
552
|
+
}
|
|
553
|
+
declare function PolySphere({ radius, subdivisions, color, ...meshProps }: PolySphereProps): react_jsx_runtime.JSX.Element;
|
|
554
|
+
interface PolyCylinderProps extends ShapeMeshProps, CylinderPolygonsOptions {
|
|
555
|
+
}
|
|
556
|
+
declare function PolyCylinder({ radius, radiusTop, height, radialSegments, color, ...meshProps }: PolyCylinderProps): react_jsx_runtime.JSX.Element;
|
|
557
|
+
interface PolyConeProps extends ShapeMeshProps, ConePolygonsOptions {
|
|
558
|
+
}
|
|
559
|
+
declare function PolyCone({ radius, height, radialSegments, color, ...meshProps }: PolyConeProps): react_jsx_runtime.JSX.Element;
|
|
560
|
+
interface PolyTorusProps extends ShapeMeshProps, TorusPolygonsOptions {
|
|
561
|
+
}
|
|
562
|
+
declare function PolyTorus({ radius, tube, radialSegments, tubularSegments, color, ...meshProps }: PolyTorusProps): react_jsx_runtime.JSX.Element;
|
|
514
563
|
|
|
515
564
|
interface PolyFirstPersonControlsOptions {
|
|
516
565
|
/** Master switch. When `false`, all sub-controls are inert. Default: `true`. */
|
|
@@ -577,7 +626,7 @@ interface PolyFirstPersonControlsProps extends PolyFirstPersonControlsOptions {
|
|
|
577
626
|
/** Called when pointer-lock is released (interaction ends). */
|
|
578
627
|
onInteractionEnd?: () => void;
|
|
579
628
|
}
|
|
580
|
-
declare const PolyFirstPersonControls:
|
|
629
|
+
declare const PolyFirstPersonControls: React$1.ForwardRefExoticComponent<PolyFirstPersonControlsProps & React$1.RefAttributes<PolyFirstPersonControlsHandle>>;
|
|
581
630
|
|
|
582
631
|
interface PolyControlsAnimateOptions {
|
|
583
632
|
/** Degrees per 60Hz-equivalent frame. Default 0.3 (≈ 18 deg/sec). */
|
|
@@ -789,6 +838,29 @@ declare function PolyDirectionalLightHelper({ light, target, distance, size, col
|
|
|
789
838
|
|
|
790
839
|
declare function injectPolyBaseStyles(doc?: Document): void;
|
|
791
840
|
|
|
841
|
+
interface PolyRenderSurfaceLeafCounts {
|
|
842
|
+
quad: number;
|
|
843
|
+
clippedSolid: number;
|
|
844
|
+
atlas: number;
|
|
845
|
+
stableTriangle: number;
|
|
846
|
+
}
|
|
847
|
+
interface PolyRenderStats {
|
|
848
|
+
polygonCount: number;
|
|
849
|
+
mountedPolygonLeafCount: number;
|
|
850
|
+
shadowLeafCount: number;
|
|
851
|
+
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
852
|
+
bucketCount: number;
|
|
853
|
+
}
|
|
854
|
+
interface PolyRenderStatsOptions {
|
|
855
|
+
polygonCount?: number;
|
|
856
|
+
/**
|
|
857
|
+
* Optional subtree selector for diagnostics that only want model leaves and
|
|
858
|
+
* not helpers/floors/gizmos sharing the same scene root.
|
|
859
|
+
*/
|
|
860
|
+
scopeSelector?: string;
|
|
861
|
+
}
|
|
862
|
+
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
863
|
+
|
|
792
864
|
interface UsePolyAnimationResult {
|
|
793
865
|
/** Attach to a `PolyAnimationTarget`-compatible handle when not using `root`. */
|
|
794
866
|
ref: RefObject<PolyAnimationTarget | null>;
|
|
@@ -807,4 +879,4 @@ interface UsePolyAnimationResult {
|
|
|
807
879
|
}
|
|
808
880
|
declare function usePolyAnimation(clips: PolyAnimationClip[] | undefined, controller: ParseAnimationController | undefined, root?: RefObject<PolyAnimationTarget | null> | PolyAnimationTarget | null): UsePolyAnimationResult;
|
|
809
881
|
|
|
810
|
-
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps,
|
|
882
|
+
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyBox, type PolyBoxProps, PolyOrthographicCamera as PolyCamera, PolyCameraContext, type PolyCameraContextValue, type PolyOrthographicCameraProps as PolyCameraProps, PolyCone, type PolyConeProps, type PolyControlsAnimateOptions, type PolyControlsCamera, PolyCylinder, type PolyCylinderProps, PolyDirectionalLightHelper, type PolyDirectionalLightHelperProps, PolyDodecahedron, type PolyDodecahedronProps, type PolyEventHandler, PolyFirstPersonControls, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, type PolyFirstPersonControlsProps, PolyGround, type PolyGroundProps, PolyIcosahedron, type PolyIcosahedronProps, PolyMapControls, type PolyControlsCamera as PolyMapControlsCamera, type PolyMapControlsProps, PolyMesh, type PolyMeshHandle, type PolyMeshProps, type PolyMouseEvent, PolyOctahedron, type PolyOctahedronProps, PolyOrbitControls, type PolyControlsCamera as PolyOrbitControlsCamera, type PolyOrbitControlsProps, PolyOrthographicCamera, type PolyOrthographicCameraProps, PolyPerspectiveCamera, type PolyPerspectiveCameraProps, PolyPlane, type PolyPlaneProps, type PolyPointerEvent, type PolyProps, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolyRing, type PolyRingProps, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, PolySphere, type PolySphereProps, PolyTetrahedron, type PolyTetrahedronProps, PolyTorus, type PolyTorusProps, PolyTransformControls, type PolyTransformControlsObject, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsProps, type PolyWheelEvent, type SharedControlsProps, type TransformProps, type UseCameraOptions, type UseCameraResult, type UseMeshOptions, type UseMeshResult, type UsePolyAnimationResult, type UseSceneContextOptions, type UseSceneContextResult, collectPolyRenderStats, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, useCameraContext, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|