@layoutit/polycss-react 0.2.4 → 0.2.6
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 +1 -1
- package/dist/index.cjs +718 -171
- package/dist/index.d.cts +115 -5
- package/dist/index.d.ts +115 -5
- package/dist/index.js +666 -110
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, CSSProperties, MouseEventHandler, PointerEventHandler, FocusEventHandler, KeyboardEventHandler, IframeHTMLAttributes, RefObject, MouseEvent as MouseEvent$1 } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as _layoutit_polycss_core from '@layoutit/polycss-core';
|
|
5
|
-
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';
|
|
6
|
-
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, OptimizeMeshParseResultOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParseStlColor, ParseStlSolid, ParseStlTopology, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyMeshTransformInput, PolyRenderStrategiesOption, PolyRenderStrategy, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SimplifyTriangleMeshPolygonsOptions, SolidTextureSampleOptions, StlParseOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildPolyMeshTransform, 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, optimizeMeshParseResult, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons,
|
|
5
|
+
import { Vec3, CameraState, CameraHandle, PolyCameraProjection, PolyTextureImageSource, PolyTexturePresentation, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, TextureQuality, PolyTextureLeafSizing, PolyTextureImageRendering, PolyTextureBackend, PolyTextureProjection, 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';
|
|
6
|
+
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, OptimizeMeshParseResultOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParseStlColor, ParseStlSolid, ParseStlTopology, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyCameraProjection, PolyCameraSnapshot, PolyCameraSnapshotOptions, PolyCameraSnapshotSource, PolyDirectionalLight, PolyMaterial, PolyMeshTransformInput, PolyRenderStrategiesOption, PolyRenderStrategy, PolySceneTransformInput, PolyTextureBackend, PolyTextureImageLighting, PolyTextureImageRendering, PolyTextureImageSource, PolyTextureLeafSizing, PolyTextureLightingMode, PolyTexturePresentation, PolyTextureProjection, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SimplifyTriangleMeshPolygonsOptions, SolidTextureSampleOptions, StlParseOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildPolyCameraSceneTransform, buildPolyMeshTransform, buildPolySceneTransform, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, capturePolyCameraSnapshot, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, conePolygons, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cssDistanceToWorld, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dodecahedronPolygons, formatColor, icosahedronPolygons, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, polyCameraTargetToCss, polyCssDistanceToWorld, polyCssPositionToWorld, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, repairMeshSeams, resolvePolyCameraAppliedPerspectiveStyle, ringPolygons, rotateVec3, seamFacetSplitPolygons, seamFacetSplitReport, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, simplifyTriangleMeshPolygons, tetrahedronPolygons, torusPolygons, worldDirectionToCss, worldDirectionToPolyCss, worldDirectionalLightToCss, worldDirectionalLightToPolyCss, worldDistanceToCss, worldDistanceToPolyCss, worldPositionToCss, worldPositionToPolyCss } from '@layoutit/polycss-core';
|
|
7
7
|
|
|
8
8
|
interface PolyPerspectiveCameraProps {
|
|
9
9
|
zoom?: number;
|
|
@@ -63,6 +63,8 @@ interface UseCameraOptions {
|
|
|
63
63
|
rotX?: number;
|
|
64
64
|
rotY?: number;
|
|
65
65
|
distance?: number;
|
|
66
|
+
projection?: PolyCameraProjection;
|
|
67
|
+
perspectiveStyle?: string;
|
|
66
68
|
}
|
|
67
69
|
interface UseCameraResult {
|
|
68
70
|
store: SceneStore;
|
|
@@ -164,8 +166,11 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
164
166
|
vertices: Vec3[];
|
|
165
167
|
color?: string;
|
|
166
168
|
texture?: string;
|
|
169
|
+
textureImageSource?: PolyTextureImageSource;
|
|
170
|
+
texturePresentation?: PolyTexturePresentation;
|
|
167
171
|
uvs?: Vec2[];
|
|
168
172
|
data?: Record<string, string | number | boolean>;
|
|
173
|
+
doubleSided?: boolean;
|
|
169
174
|
/** Shared material. When set AND the polygon's UVs form an axis-aligned
|
|
170
175
|
* rectangle, renders via `background-image` directly — no per-polygon
|
|
171
176
|
* canvas rasterization. Falls back to the atlas path otherwise. */
|
|
@@ -176,6 +181,10 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
176
181
|
directionalLight?: PolyDirectionalLight;
|
|
177
182
|
textureLighting?: PolyTextureLightingMode;
|
|
178
183
|
textureQuality?: TextureQuality;
|
|
184
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
185
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
186
|
+
textureBackend?: PolyTextureBackend;
|
|
187
|
+
textureProjection?: PolyTextureProjection;
|
|
179
188
|
debugShowBackfaces?: boolean;
|
|
180
189
|
[key: string]: unknown;
|
|
181
190
|
};
|
|
@@ -184,6 +193,14 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
184
193
|
/** Atlas bitmap budget and CSS sprite size. `"auto"` (default) uses a
|
|
185
194
|
* device-appropriate memory budget and desktop/mobile sprite sizing. */
|
|
186
195
|
textureQuality?: TextureQuality;
|
|
196
|
+
/** Atlas leaf CSS primitive sizing. Defaults to scene context, then canonical. */
|
|
197
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
198
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
199
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
200
|
+
/** Default texture backend request. Defaults to scene context, then "auto". */
|
|
201
|
+
textureBackend?: PolyTextureBackend;
|
|
202
|
+
/** Default texture projection request. Defaults to scene context, then "affine". */
|
|
203
|
+
textureProjection?: PolyTextureProjection;
|
|
187
204
|
/** Pre-computed shaded base color from the parent (optional override). */
|
|
188
205
|
baseColor?: string;
|
|
189
206
|
}
|
|
@@ -218,6 +235,14 @@ interface PolySceneProps extends TransformProps {
|
|
|
218
235
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
219
236
|
* raster scale and the 64px sprite. */
|
|
220
237
|
textureQuality?: TextureQuality;
|
|
238
|
+
/** Atlas leaf CSS primitive sizing. Defaults to canonical browser-fast sizing. */
|
|
239
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
240
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
241
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
242
|
+
/** Default texture backend request. Defaults to "auto". */
|
|
243
|
+
textureBackend?: PolyTextureBackend;
|
|
244
|
+
/** Default texture projection request. Defaults to "affine". */
|
|
245
|
+
textureProjection?: PolyTextureProjection;
|
|
221
246
|
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
222
247
|
seamBleed?: PolySeamBleed;
|
|
223
248
|
/**
|
|
@@ -250,7 +275,7 @@ interface PolySceneProps extends TransformProps {
|
|
|
250
275
|
debugShowLabels?: boolean;
|
|
251
276
|
debugShowBackfaces?: boolean;
|
|
252
277
|
}
|
|
253
|
-
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;
|
|
278
|
+
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, textureLeafSizing, textureImageRendering, textureBackend, textureProjection, seamBleed, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
254
279
|
declare const PolyScene: React$1.MemoExoticComponent<typeof PolySceneInner>;
|
|
255
280
|
|
|
256
281
|
type UseMeshOptions = LoadMeshOptions;
|
|
@@ -331,6 +356,8 @@ interface PolyMeshHandle {
|
|
|
331
356
|
* safe to call.
|
|
332
357
|
*/
|
|
333
358
|
rebakeAtlas(): void;
|
|
359
|
+
/** Resolves when this mesh's current texture generation has usable backgrounds. */
|
|
360
|
+
whenTexturesReady(): Promise<void>;
|
|
334
361
|
/**
|
|
335
362
|
* Mutate a single polygon in place and re-render the mesh. `target` is
|
|
336
363
|
* either a polygon reference (as returned by `getPolygons()`) or its index.
|
|
@@ -438,6 +465,14 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
438
465
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
439
466
|
* raster scale and the 64px sprite. */
|
|
440
467
|
textureQuality?: TextureQuality;
|
|
468
|
+
/** Atlas leaf CSS primitive sizing. Defaults to scene context, then canonical. */
|
|
469
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
470
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
471
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
472
|
+
/** Default texture backend request. Defaults to scene context, then "auto". */
|
|
473
|
+
textureBackend?: PolyTextureBackend;
|
|
474
|
+
/** Default texture projection request. Defaults to scene context, then "affine". */
|
|
475
|
+
textureProjection?: PolyTextureProjection;
|
|
441
476
|
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
442
477
|
seamBleed?: PolySeamBleed;
|
|
443
478
|
/**
|
|
@@ -580,7 +615,7 @@ declare function usePolyMaterial(options: {
|
|
|
580
615
|
* check is sound here because polygon data (vertices, color, texture) is
|
|
581
616
|
* typically created once at parse time and passed by reference.
|
|
582
617
|
*/
|
|
583
|
-
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;
|
|
618
|
+
declare function PolyInner({ vertices, color, texture, textureImageSource, texturePresentation, uvs, data, doubleSided, 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, textureLeafSizing: textureLeafSizingProp, textureImageRendering: textureImageRenderingProp, textureBackend: textureBackendProp, textureProjection: textureProjectionProp, baseColor: baseColorProp, ...dataAttrs }: PolyProps): react_jsx_runtime.JSX.Element | null;
|
|
584
619
|
declare const Poly: React__default.MemoExoticComponent<typeof PolyInner>;
|
|
585
620
|
|
|
586
621
|
type ShapeMeshProps = Omit<PolyMeshProps, "polygons" | "src" | "mtl">;
|
|
@@ -902,11 +937,84 @@ interface PolyRenderSurfaceLeafCounts {
|
|
|
902
937
|
atlas: number;
|
|
903
938
|
stableTriangle: number;
|
|
904
939
|
}
|
|
940
|
+
type PolyRenderLeafStrategy = keyof PolyRenderSurfaceLeafCounts;
|
|
941
|
+
interface PolyTextureReadiness {
|
|
942
|
+
ready: boolean;
|
|
943
|
+
textureLeafCount: number;
|
|
944
|
+
readyTextureLeafCount: number;
|
|
945
|
+
pendingTextureLeafCount: number;
|
|
946
|
+
atlasTextureLeafCount: number;
|
|
947
|
+
imageTextureLeafCount: number;
|
|
948
|
+
}
|
|
949
|
+
interface PolyTextureRenderStats {
|
|
950
|
+
ready: boolean;
|
|
951
|
+
leafCount: number;
|
|
952
|
+
atlasCount: number;
|
|
953
|
+
imageCount: number;
|
|
954
|
+
pendingCount: number;
|
|
955
|
+
sizingCounts: {
|
|
956
|
+
canonical: number;
|
|
957
|
+
local: number;
|
|
958
|
+
raster: number;
|
|
959
|
+
image: number;
|
|
960
|
+
unknown: number;
|
|
961
|
+
};
|
|
962
|
+
imageRenderingCounts: {
|
|
963
|
+
auto: number;
|
|
964
|
+
pixelated: number;
|
|
965
|
+
unknown: number;
|
|
966
|
+
};
|
|
967
|
+
projectionCounts: {
|
|
968
|
+
affine: number;
|
|
969
|
+
projective: number;
|
|
970
|
+
fallback: number;
|
|
971
|
+
unknown: number;
|
|
972
|
+
};
|
|
973
|
+
minLeafWidth: number;
|
|
974
|
+
maxLeafWidth: number;
|
|
975
|
+
minLeafHeight: number;
|
|
976
|
+
maxLeafHeight: number;
|
|
977
|
+
doubleSidedCount: number;
|
|
978
|
+
}
|
|
979
|
+
interface PolySnapshotRenderStats {
|
|
980
|
+
runtimeAtlasUrlCount: number;
|
|
981
|
+
snapshotAtlasCount: number;
|
|
982
|
+
snapshotBackgroundCount: number;
|
|
983
|
+
selfContained: boolean;
|
|
984
|
+
}
|
|
985
|
+
interface PolyCameraSnapshotStats {
|
|
986
|
+
rootFound: boolean;
|
|
987
|
+
projection: "orthographic" | "perspective" | "unknown";
|
|
988
|
+
perspectiveStyle: string;
|
|
989
|
+
appliedPerspectiveStyle: string;
|
|
990
|
+
zoom?: number;
|
|
991
|
+
distance?: number;
|
|
992
|
+
rotX?: number;
|
|
993
|
+
rotY?: number;
|
|
994
|
+
target?: [number, number, number];
|
|
995
|
+
}
|
|
996
|
+
interface PolyLeafInfo {
|
|
997
|
+
element: HTMLElement;
|
|
998
|
+
strategy: PolyRenderLeafStrategy;
|
|
999
|
+
polygonIndex?: number;
|
|
1000
|
+
textureBackend?: string;
|
|
1001
|
+
textureReady?: boolean;
|
|
1002
|
+
textureLeafSizing?: string;
|
|
1003
|
+
textureImageRendering?: string;
|
|
1004
|
+
textureProjection?: string;
|
|
1005
|
+
textureLeafWidth?: number;
|
|
1006
|
+
textureLeafHeight?: number;
|
|
1007
|
+
doubleSided?: boolean;
|
|
1008
|
+
}
|
|
905
1009
|
interface PolyRenderStats {
|
|
906
1010
|
polygonCount: number;
|
|
907
1011
|
mountedPolygonLeafCount: number;
|
|
908
1012
|
shadowLeafCount: number;
|
|
909
1013
|
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
1014
|
+
textureReadiness: PolyTextureReadiness;
|
|
1015
|
+
textureStats: PolyTextureRenderStats;
|
|
1016
|
+
snapshotStats: PolySnapshotRenderStats;
|
|
1017
|
+
cameraStats: PolyCameraSnapshotStats;
|
|
910
1018
|
bucketCount: number;
|
|
911
1019
|
}
|
|
912
1020
|
interface PolyRenderStatsOptions {
|
|
@@ -917,6 +1025,8 @@ interface PolyRenderStatsOptions {
|
|
|
917
1025
|
*/
|
|
918
1026
|
scopeSelector?: string;
|
|
919
1027
|
}
|
|
1028
|
+
declare function queryPolyLeaves(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyLeafInfo[];
|
|
1029
|
+
declare function collectPolyTextureReadiness(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyTextureReadiness;
|
|
920
1030
|
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
921
1031
|
|
|
922
1032
|
interface UsePolyAnimationResult {
|
|
@@ -937,4 +1047,4 @@ interface UsePolyAnimationResult {
|
|
|
937
1047
|
}
|
|
938
1048
|
declare function usePolyAnimation(clips: PolyAnimationClip[] | undefined, controller: ParseAnimationController | undefined, root?: RefObject<PolyAnimationTarget | null> | PolyAnimationTarget | null): UsePolyAnimationResult;
|
|
939
1049
|
|
|
940
|
-
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, PolyIframe, type PolyIframeProps, 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 };
|
|
1050
|
+
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyBox, type PolyBoxProps, PolyOrthographicCamera as PolyCamera, PolyCameraContext, type PolyCameraContextValue, type PolyOrthographicCameraProps as PolyCameraProps, type PolyCameraSnapshotStats, 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, PolyIframe, type PolyIframeProps, type PolyLeafInfo, 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 PolyRenderLeafStrategy, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolyRing, type PolyRingProps, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, type PolySnapshotRenderStats, PolySphere, type PolySphereProps, PolyTetrahedron, type PolyTetrahedronProps, type PolyTextureReadiness, type PolyTextureRenderStats, 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, collectPolyTextureReadiness, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, queryPolyLeaves, useCameraContext, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as React$1 from 'react';
|
|
|
2
2
|
import React__default, { ReactNode, CSSProperties, MouseEventHandler, PointerEventHandler, FocusEventHandler, KeyboardEventHandler, IframeHTMLAttributes, RefObject, MouseEvent as MouseEvent$1 } from 'react';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import * as _layoutit_polycss_core from '@layoutit/polycss-core';
|
|
5
|
-
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';
|
|
6
|
-
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, OptimizeMeshParseResultOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParseStlColor, ParseStlSolid, ParseStlTopology, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyMeshTransformInput, PolyRenderStrategiesOption, PolyRenderStrategy, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SimplifyTriangleMeshPolygonsOptions, SolidTextureSampleOptions, StlParseOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildPolyMeshTransform, 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, optimizeMeshParseResult, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons,
|
|
5
|
+
import { Vec3, CameraState, CameraHandle, PolyCameraProjection, PolyTextureImageSource, PolyTexturePresentation, Vec2, PolyMaterial, PolyDirectionalLight, PolyTextureLightingMode, TextureQuality, PolyTextureLeafSizing, PolyTextureImageRendering, PolyTextureBackend, PolyTextureProjection, 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';
|
|
6
|
+
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, OptimizeMeshParseResultOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParseStlColor, ParseStlSolid, ParseStlTopology, ParsedColor, PlanePolygonsOptions, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyCameraProjection, PolyCameraSnapshot, PolyCameraSnapshotOptions, PolyCameraSnapshotSource, PolyDirectionalLight, PolyMaterial, PolyMeshTransformInput, PolyRenderStrategiesOption, PolyRenderStrategy, PolySceneTransformInput, PolyTextureBackend, PolyTextureImageLighting, PolyTextureImageRendering, PolyTextureImageSource, PolyTextureLeafSizing, PolyTextureLightingMode, PolyTexturePresentation, PolyTextureProjection, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SeamFacetSplitCandidate, SeamFacetSplitCandidateReason, SeamFacetSplitOptions, SeamFacetSplitReport, SeamOverlapCandidate, SeamOverlapCandidateKind, SeamOverlapDiagnostics, SeamOverlapOptions, SimplifyTriangleMeshPolygonsOptions, SolidTextureSampleOptions, StlParseOptions, TetrahedronPolygonsOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, TorusPolygonsOptions, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, boxPolygons, buildPolyCameraSceneTransform, buildPolyMeshTransform, buildPolySceneTransform, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, capturePolyCameraSnapshot, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, conePolygons, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cssDistanceToWorld, cssPositionToWorld, cullInteriorPolygons, cylinderPolygons, dodecahedronPolygons, formatColor, icosahedronPolygons, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeAnimatedMeshPolygons, optimizeMeshParseResult, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseStl, parseVox, planePolygons, polyCameraTargetToCss, polyCssDistanceToWorld, polyCssPositionToWorld, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, repairMeshSeams, resolvePolyCameraAppliedPerspectiveStyle, ringPolygons, rotateVec3, seamFacetSplitPolygons, seamFacetSplitReport, seamOverlapDiagnostics, seamOverlapPolygons, seamOverlapReport, shadeColor, simplifyTriangleMeshPolygons, tetrahedronPolygons, torusPolygons, worldDirectionToCss, worldDirectionToPolyCss, worldDirectionalLightToCss, worldDirectionalLightToPolyCss, worldDistanceToCss, worldDistanceToPolyCss, worldPositionToCss, worldPositionToPolyCss } from '@layoutit/polycss-core';
|
|
7
7
|
|
|
8
8
|
interface PolyPerspectiveCameraProps {
|
|
9
9
|
zoom?: number;
|
|
@@ -63,6 +63,8 @@ interface UseCameraOptions {
|
|
|
63
63
|
rotX?: number;
|
|
64
64
|
rotY?: number;
|
|
65
65
|
distance?: number;
|
|
66
|
+
projection?: PolyCameraProjection;
|
|
67
|
+
perspectiveStyle?: string;
|
|
66
68
|
}
|
|
67
69
|
interface UseCameraResult {
|
|
68
70
|
store: SceneStore;
|
|
@@ -164,8 +166,11 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
164
166
|
vertices: Vec3[];
|
|
165
167
|
color?: string;
|
|
166
168
|
texture?: string;
|
|
169
|
+
textureImageSource?: PolyTextureImageSource;
|
|
170
|
+
texturePresentation?: PolyTexturePresentation;
|
|
167
171
|
uvs?: Vec2[];
|
|
168
172
|
data?: Record<string, string | number | boolean>;
|
|
173
|
+
doubleSided?: boolean;
|
|
169
174
|
/** Shared material. When set AND the polygon's UVs form an axis-aligned
|
|
170
175
|
* rectangle, renders via `background-image` directly — no per-polygon
|
|
171
176
|
* canvas rasterization. Falls back to the atlas path otherwise. */
|
|
@@ -176,6 +181,10 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
176
181
|
directionalLight?: PolyDirectionalLight;
|
|
177
182
|
textureLighting?: PolyTextureLightingMode;
|
|
178
183
|
textureQuality?: TextureQuality;
|
|
184
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
185
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
186
|
+
textureBackend?: PolyTextureBackend;
|
|
187
|
+
textureProjection?: PolyTextureProjection;
|
|
179
188
|
debugShowBackfaces?: boolean;
|
|
180
189
|
[key: string]: unknown;
|
|
181
190
|
};
|
|
@@ -184,6 +193,14 @@ interface PolyProps extends TransformProps, DOMPassthroughProps {
|
|
|
184
193
|
/** Atlas bitmap budget and CSS sprite size. `"auto"` (default) uses a
|
|
185
194
|
* device-appropriate memory budget and desktop/mobile sprite sizing. */
|
|
186
195
|
textureQuality?: TextureQuality;
|
|
196
|
+
/** Atlas leaf CSS primitive sizing. Defaults to scene context, then canonical. */
|
|
197
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
198
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
199
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
200
|
+
/** Default texture backend request. Defaults to scene context, then "auto". */
|
|
201
|
+
textureBackend?: PolyTextureBackend;
|
|
202
|
+
/** Default texture projection request. Defaults to scene context, then "affine". */
|
|
203
|
+
textureProjection?: PolyTextureProjection;
|
|
187
204
|
/** Pre-computed shaded base color from the parent (optional override). */
|
|
188
205
|
baseColor?: string;
|
|
189
206
|
}
|
|
@@ -218,6 +235,14 @@ interface PolySceneProps extends TransformProps {
|
|
|
218
235
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
219
236
|
* raster scale and the 64px sprite. */
|
|
220
237
|
textureQuality?: TextureQuality;
|
|
238
|
+
/** Atlas leaf CSS primitive sizing. Defaults to canonical browser-fast sizing. */
|
|
239
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
240
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
241
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
242
|
+
/** Default texture backend request. Defaults to "auto". */
|
|
243
|
+
textureBackend?: PolyTextureBackend;
|
|
244
|
+
/** Default texture projection request. Defaults to "affine". */
|
|
245
|
+
textureProjection?: PolyTextureProjection;
|
|
221
246
|
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
222
247
|
seamBleed?: PolySeamBleed;
|
|
223
248
|
/**
|
|
@@ -250,7 +275,7 @@ interface PolySceneProps extends TransformProps {
|
|
|
250
275
|
debugShowLabels?: boolean;
|
|
251
276
|
debugShowBackfaces?: boolean;
|
|
252
277
|
}
|
|
253
|
-
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;
|
|
278
|
+
declare function PolySceneInner({ polygons: polygonsProp, centerPolygons: centerPolygonsProp, perspective: _perspective, rotX: _rotX, rotY: _rotY, zoom: _zoom, directionalLight, ambientLight, textureLighting, textureQuality, textureLeafSizing, textureImageRendering, textureBackend, textureProjection, seamBleed, strategies, autoCenter, shadow, className, style, children, position: _position, scale: _scale, rotation: _rotation, debugShowLabels: _debugShowLabels, debugShowBackfaces, }: PolySceneProps): react_jsx_runtime.JSX.Element;
|
|
254
279
|
declare const PolyScene: React$1.MemoExoticComponent<typeof PolySceneInner>;
|
|
255
280
|
|
|
256
281
|
type UseMeshOptions = LoadMeshOptions;
|
|
@@ -331,6 +356,8 @@ interface PolyMeshHandle {
|
|
|
331
356
|
* safe to call.
|
|
332
357
|
*/
|
|
333
358
|
rebakeAtlas(): void;
|
|
359
|
+
/** Resolves when this mesh's current texture generation has usable backgrounds. */
|
|
360
|
+
whenTexturesReady(): Promise<void>;
|
|
334
361
|
/**
|
|
335
362
|
* Mutate a single polygon in place and re-render the mesh. `target` is
|
|
336
363
|
* either a polygon reference (as returned by `getPolygons()`) or its index.
|
|
@@ -438,6 +465,14 @@ interface PolyMeshProps extends TransformProps, InteractionProps {
|
|
|
438
465
|
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
439
466
|
* raster scale and the 64px sprite. */
|
|
440
467
|
textureQuality?: TextureQuality;
|
|
468
|
+
/** Atlas leaf CSS primitive sizing. Defaults to scene context, then canonical. */
|
|
469
|
+
textureLeafSizing?: PolyTextureLeafSizing;
|
|
470
|
+
/** Default image filtering for atlas and direct image texture leaves. */
|
|
471
|
+
textureImageRendering?: PolyTextureImageRendering;
|
|
472
|
+
/** Default texture backend request. Defaults to scene context, then "auto". */
|
|
473
|
+
textureBackend?: PolyTextureBackend;
|
|
474
|
+
/** Default texture projection request. Defaults to scene context, then "affine". */
|
|
475
|
+
textureProjection?: PolyTextureProjection;
|
|
441
476
|
/** Solid seam overscan. `"auto"` computes a fitted per-edge amount from the polygon plan. */
|
|
442
477
|
seamBleed?: PolySeamBleed;
|
|
443
478
|
/**
|
|
@@ -580,7 +615,7 @@ declare function usePolyMaterial(options: {
|
|
|
580
615
|
* check is sound here because polygon data (vertices, color, texture) is
|
|
581
616
|
* typically created once at parse time and passed by reference.
|
|
582
617
|
*/
|
|
583
|
-
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;
|
|
618
|
+
declare function PolyInner({ vertices, color, texture, textureImageSource, texturePresentation, uvs, data, doubleSided, 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, textureLeafSizing: textureLeafSizingProp, textureImageRendering: textureImageRenderingProp, textureBackend: textureBackendProp, textureProjection: textureProjectionProp, baseColor: baseColorProp, ...dataAttrs }: PolyProps): react_jsx_runtime.JSX.Element | null;
|
|
584
619
|
declare const Poly: React__default.MemoExoticComponent<typeof PolyInner>;
|
|
585
620
|
|
|
586
621
|
type ShapeMeshProps = Omit<PolyMeshProps, "polygons" | "src" | "mtl">;
|
|
@@ -902,11 +937,84 @@ interface PolyRenderSurfaceLeafCounts {
|
|
|
902
937
|
atlas: number;
|
|
903
938
|
stableTriangle: number;
|
|
904
939
|
}
|
|
940
|
+
type PolyRenderLeafStrategy = keyof PolyRenderSurfaceLeafCounts;
|
|
941
|
+
interface PolyTextureReadiness {
|
|
942
|
+
ready: boolean;
|
|
943
|
+
textureLeafCount: number;
|
|
944
|
+
readyTextureLeafCount: number;
|
|
945
|
+
pendingTextureLeafCount: number;
|
|
946
|
+
atlasTextureLeafCount: number;
|
|
947
|
+
imageTextureLeafCount: number;
|
|
948
|
+
}
|
|
949
|
+
interface PolyTextureRenderStats {
|
|
950
|
+
ready: boolean;
|
|
951
|
+
leafCount: number;
|
|
952
|
+
atlasCount: number;
|
|
953
|
+
imageCount: number;
|
|
954
|
+
pendingCount: number;
|
|
955
|
+
sizingCounts: {
|
|
956
|
+
canonical: number;
|
|
957
|
+
local: number;
|
|
958
|
+
raster: number;
|
|
959
|
+
image: number;
|
|
960
|
+
unknown: number;
|
|
961
|
+
};
|
|
962
|
+
imageRenderingCounts: {
|
|
963
|
+
auto: number;
|
|
964
|
+
pixelated: number;
|
|
965
|
+
unknown: number;
|
|
966
|
+
};
|
|
967
|
+
projectionCounts: {
|
|
968
|
+
affine: number;
|
|
969
|
+
projective: number;
|
|
970
|
+
fallback: number;
|
|
971
|
+
unknown: number;
|
|
972
|
+
};
|
|
973
|
+
minLeafWidth: number;
|
|
974
|
+
maxLeafWidth: number;
|
|
975
|
+
minLeafHeight: number;
|
|
976
|
+
maxLeafHeight: number;
|
|
977
|
+
doubleSidedCount: number;
|
|
978
|
+
}
|
|
979
|
+
interface PolySnapshotRenderStats {
|
|
980
|
+
runtimeAtlasUrlCount: number;
|
|
981
|
+
snapshotAtlasCount: number;
|
|
982
|
+
snapshotBackgroundCount: number;
|
|
983
|
+
selfContained: boolean;
|
|
984
|
+
}
|
|
985
|
+
interface PolyCameraSnapshotStats {
|
|
986
|
+
rootFound: boolean;
|
|
987
|
+
projection: "orthographic" | "perspective" | "unknown";
|
|
988
|
+
perspectiveStyle: string;
|
|
989
|
+
appliedPerspectiveStyle: string;
|
|
990
|
+
zoom?: number;
|
|
991
|
+
distance?: number;
|
|
992
|
+
rotX?: number;
|
|
993
|
+
rotY?: number;
|
|
994
|
+
target?: [number, number, number];
|
|
995
|
+
}
|
|
996
|
+
interface PolyLeafInfo {
|
|
997
|
+
element: HTMLElement;
|
|
998
|
+
strategy: PolyRenderLeafStrategy;
|
|
999
|
+
polygonIndex?: number;
|
|
1000
|
+
textureBackend?: string;
|
|
1001
|
+
textureReady?: boolean;
|
|
1002
|
+
textureLeafSizing?: string;
|
|
1003
|
+
textureImageRendering?: string;
|
|
1004
|
+
textureProjection?: string;
|
|
1005
|
+
textureLeafWidth?: number;
|
|
1006
|
+
textureLeafHeight?: number;
|
|
1007
|
+
doubleSided?: boolean;
|
|
1008
|
+
}
|
|
905
1009
|
interface PolyRenderStats {
|
|
906
1010
|
polygonCount: number;
|
|
907
1011
|
mountedPolygonLeafCount: number;
|
|
908
1012
|
shadowLeafCount: number;
|
|
909
1013
|
surfaceLeafCounts: PolyRenderSurfaceLeafCounts;
|
|
1014
|
+
textureReadiness: PolyTextureReadiness;
|
|
1015
|
+
textureStats: PolyTextureRenderStats;
|
|
1016
|
+
snapshotStats: PolySnapshotRenderStats;
|
|
1017
|
+
cameraStats: PolyCameraSnapshotStats;
|
|
910
1018
|
bucketCount: number;
|
|
911
1019
|
}
|
|
912
1020
|
interface PolyRenderStatsOptions {
|
|
@@ -917,6 +1025,8 @@ interface PolyRenderStatsOptions {
|
|
|
917
1025
|
*/
|
|
918
1026
|
scopeSelector?: string;
|
|
919
1027
|
}
|
|
1028
|
+
declare function queryPolyLeaves(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyLeafInfo[];
|
|
1029
|
+
declare function collectPolyTextureReadiness(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyTextureReadiness;
|
|
920
1030
|
declare function collectPolyRenderStats(root: ParentNode | null | undefined, optionsOrPolygonCount?: number | PolyRenderStatsOptions): PolyRenderStats;
|
|
921
1031
|
|
|
922
1032
|
interface UsePolyAnimationResult {
|
|
@@ -937,4 +1047,4 @@ interface UsePolyAnimationResult {
|
|
|
937
1047
|
}
|
|
938
1048
|
declare function usePolyAnimation(clips: PolyAnimationClip[] | undefined, controller: ParseAnimationController | undefined, root?: RefObject<PolyAnimationTarget | null> | PolyAnimationTarget | null): UsePolyAnimationResult;
|
|
939
1049
|
|
|
940
|
-
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, PolyIframe, type PolyIframeProps, 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 };
|
|
1050
|
+
export { type DOMPassthroughProps, type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyBox, type PolyBoxProps, PolyOrthographicCamera as PolyCamera, PolyCameraContext, type PolyCameraContextValue, type PolyOrthographicCameraProps as PolyCameraProps, type PolyCameraSnapshotStats, 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, PolyIframe, type PolyIframeProps, type PolyLeafInfo, 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 PolyRenderLeafStrategy, type PolyRenderStats, type PolyRenderStatsOptions, type PolyRenderSurfaceLeafCounts, PolyRing, type PolyRingProps, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, type PolySnapshotRenderStats, PolySphere, type PolySphereProps, PolyTetrahedron, type PolyTetrahedronProps, type PolyTextureReadiness, type PolyTextureRenderStats, 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, collectPolyTextureReadiness, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, queryPolyLeaves, useCameraContext, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|