@layoutit/polycss-vue 0.0.1 → 0.2.0
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 +3 -3
- package/dist/index.cjs +146 -18
- package/dist/index.d.cts +388 -26
- package/dist/index.d.ts +388 -26
- package/dist/index.js +146 -18
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vue from 'vue';
|
|
2
2
|
import { PropType, Ref, InjectionKey, VNode, ComputedRef, MaybeRef } from 'vue';
|
|
3
3
|
import { Vec3, CameraState, CameraHandle, Polygon, PolyDirectionalLight, PolyAmbientLight, PolyTextureLightingMode, LoadMeshOptions, PolyMaterial, Vec2, PolyAnimationTarget, PolyAnimationMixer, PolyAnimationClip, PolyAnimationAction, ParseAnimationController } from '@layoutit/polycss-core';
|
|
4
|
-
export { ArrowPolygonsOptions, AutoRotateConfig, AutoRotateOption, AxesHelperOptions, BASE_TILE, CameraHandle, CameraState, CameraStyleInput, CoverPlanarPolygonsOptions, CullInteriorOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, GltfParseOptions, LoadMeshOptions, LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MtlParseResult, NormalizeResult, ObjParseOptions, OctahedronPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParsedColor, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SolidTextureSampleOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, buildSceneContext, clampChannel, computeSceneBbox, computeShapeLighting, computeTexturePaintMetrics, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cullInteriorPolygons, formatColor, inverseRotateVec3, loadMesh, mergePolygons, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, polygonFaces, ringPolygons, rotateVec3, shadeColor } from '@layoutit/polycss-core';
|
|
4
|
+
export { ApproximateMergeOptions, ArrowPolygonsOptions, AutoRotateConfig, AutoRotateOption, AxesHelperOptions, BASE_TILE, BoxFace, BoxFaceOptions, BoxPolygonsOptions, CAMERA_BACKFACE_CULL_EPS, CameraCullNormalGroup, CameraCullRotation, CameraHandle, CameraState, CameraStyleInput, CoverPlanarPolygonsOptions, CullInteriorOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, GltfParseOptions, LoadMeshOptions, LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MeshResolution, MtlParseResult, NormalizeResult, ObjParseOptions, OctahedronPolygonsOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParsedColor, PolyAmbientLight, PolyAnimationAction, PolyAnimationClip, PolyAnimationMixer, PolyAnimationTarget, PolyDirectionalLight, PolyMaterial, PolyTextureLightingMode, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SolidTextureSampleOptions, TexturePaintMetrics, TexturePaintMetricsOptions, TextureTriangle, 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, coverPlanarPolygons, createIsometricCamera, createPolyAnimationMixer, cullInteriorPolygons, formatColor, inverseRotateVec3, isAxisAlignedSurfaceNormal, isVoxelCameraCullableNormalGroups, loadMesh, mergePolygons, normalFacesCamera, normalizeInvertMultiplier, normalizePolygons, octahedronPolygons, optimizeMeshPolygons, parseColor, parseGltf, parseHexColor, parseMtl, parseObj, parsePureColor, parseRgbColor, parseVox, polygonCssSurfaceNormal, polygonFaces, polygonFacesCamera, ringPolygons, rotateVec3, shadeColor } from '@layoutit/polycss-core';
|
|
5
5
|
|
|
6
6
|
interface PolyPerspectiveCameraProps {
|
|
7
7
|
zoom?: number;
|
|
@@ -154,6 +154,12 @@ interface UseCameraResult {
|
|
|
154
154
|
* versions and can't preventDefault).
|
|
155
155
|
*/
|
|
156
156
|
cameraElRef: Ref<HTMLDivElement | null>;
|
|
157
|
+
/**
|
|
158
|
+
* Bbox-center of all centerable meshes in world coords. Written by
|
|
159
|
+
* <PolyScene> when autoCenter is enabled. Read by applyTransformDirect
|
|
160
|
+
* to fold the offset into the scene transform without a DOM wrapper.
|
|
161
|
+
*/
|
|
162
|
+
autoCenterOffset: Ref<Vec3>;
|
|
157
163
|
/**
|
|
158
164
|
* Apply the current camera state (from cameraRef.value.state) directly
|
|
159
165
|
* to sceneEl.style.transform. Exposed so layered components like
|
|
@@ -172,6 +178,14 @@ interface PolyCameraContextValue {
|
|
|
172
178
|
* <PolyControls> can attach pointer/wheel listeners.
|
|
173
179
|
*/
|
|
174
180
|
cameraElRef: Ref<HTMLElement | null>;
|
|
181
|
+
/**
|
|
182
|
+
* Bbox-center of all centerable meshes in world coords, written by
|
|
183
|
+
* <PolyScene> when `autoCenter` is enabled. `applyTransformDirect`
|
|
184
|
+
* folds this into the innermost translate3d alongside `target` so the
|
|
185
|
+
* camera orbits the model's visible center without adding a DOM wrapper.
|
|
186
|
+
* Kept separate from `target` so user pan survives mesh add/remove.
|
|
187
|
+
*/
|
|
188
|
+
autoCenterOffset: Ref<Vec3>;
|
|
175
189
|
/**
|
|
176
190
|
* Apply the current camera state (from cameraRef.value.state) directly
|
|
177
191
|
* to sceneEl.style.transform. Layered components call this after
|
|
@@ -181,7 +195,28 @@ interface PolyCameraContextValue {
|
|
|
181
195
|
}
|
|
182
196
|
declare const PolyCameraContextKey: InjectionKey<PolyCameraContextValue>;
|
|
183
197
|
|
|
184
|
-
|
|
198
|
+
/**
|
|
199
|
+
* PolySceneContext — propagates scene-level rendering options
|
|
200
|
+
* (textureLighting + lights) to descendants. PolyMesh / Poly children
|
|
201
|
+
* inherit these as fallbacks when their own equivalent props are
|
|
202
|
+
* undefined, so a helper rendered inside `<PolyScene texture-lighting="dynamic">`
|
|
203
|
+
* picks up the dynamic mode automatically (per-polygon normal vars + mask).
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
interface PolyShadowOptions {
|
|
207
|
+
color?: string;
|
|
208
|
+
opacity?: number;
|
|
209
|
+
lift?: number;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
type TextureQuality = number | "auto";
|
|
213
|
+
type PolyRenderStrategy = "b" | "i" | "u";
|
|
214
|
+
interface PolyRenderStrategiesOption {
|
|
215
|
+
/** Strategies to skip; polygons that would normally use them fall through
|
|
216
|
+
* the chain (b → i → s, u → i → s, i → s). `<s>` is the universal
|
|
217
|
+
* fallback and cannot be disabled — textured polys have no other path. */
|
|
218
|
+
disable?: readonly PolyRenderStrategy[];
|
|
219
|
+
}
|
|
185
220
|
|
|
186
221
|
interface PolySceneProps {
|
|
187
222
|
polygons?: Polygon[];
|
|
@@ -192,8 +227,13 @@ interface PolySceneProps {
|
|
|
192
227
|
directionalLight?: PolyDirectionalLight;
|
|
193
228
|
ambientLight?: PolyAmbientLight;
|
|
194
229
|
textureLighting?: PolyTextureLightingMode;
|
|
195
|
-
/**
|
|
196
|
-
|
|
230
|
+
/** Atlas bitmap budget and CSS sprite size. `"auto"` (default) uses a
|
|
231
|
+
* device-appropriate memory budget (~4 MB mobile / ~16 MB desktop) and
|
|
232
|
+
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
233
|
+
* raster scale and the 64px sprite. */
|
|
234
|
+
textureQuality?: TextureQuality;
|
|
235
|
+
/** Opt out of specific render strategies. Disabled strategies fall through the chain (b→i→s, u→i→s, i→s). `<s>` cannot be disabled. */
|
|
236
|
+
strategies?: PolyRenderStrategiesOption;
|
|
197
237
|
/**
|
|
198
238
|
* When `true`, rotation pivots around the mesh's bbox center instead of
|
|
199
239
|
* world (0,0,0). Polygon data is not mutated — a wrapper div translates
|
|
@@ -201,6 +241,12 @@ interface PolySceneProps {
|
|
|
201
241
|
* Mirrors React's PolyScene autoCenter prop.
|
|
202
242
|
*/
|
|
203
243
|
autoCenter?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Shadow appearance for meshes with `castShadow: true`. Only applies in
|
|
246
|
+
* dynamic lighting mode — baked mode does not emit shadow leaves.
|
|
247
|
+
* Defaults: `{ color: "#000000", opacity: 0.25, lift: 0.05 }`.
|
|
248
|
+
*/
|
|
249
|
+
shadow?: PolyShadowOptions;
|
|
204
250
|
class?: string;
|
|
205
251
|
position?: Vec3;
|
|
206
252
|
scale?: number | Vec3;
|
|
@@ -237,14 +283,22 @@ declare const PolyScene: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
237
283
|
type: PropType<PolyTextureLightingMode>;
|
|
238
284
|
default: string;
|
|
239
285
|
};
|
|
240
|
-
|
|
241
|
-
type: PropType<
|
|
286
|
+
textureQuality: {
|
|
287
|
+
type: PropType<TextureQuality>;
|
|
288
|
+
default: undefined;
|
|
289
|
+
};
|
|
290
|
+
strategies: {
|
|
291
|
+
type: PropType<PolyRenderStrategiesOption>;
|
|
242
292
|
default: undefined;
|
|
243
293
|
};
|
|
244
294
|
autoCenter: {
|
|
245
295
|
type: BooleanConstructor;
|
|
246
296
|
default: boolean;
|
|
247
297
|
};
|
|
298
|
+
shadow: {
|
|
299
|
+
type: PropType<PolyShadowOptions>;
|
|
300
|
+
default: undefined;
|
|
301
|
+
};
|
|
248
302
|
class: {
|
|
249
303
|
type: StringConstructor;
|
|
250
304
|
};
|
|
@@ -297,14 +351,22 @@ declare const PolyScene: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
297
351
|
type: PropType<PolyTextureLightingMode>;
|
|
298
352
|
default: string;
|
|
299
353
|
};
|
|
300
|
-
|
|
301
|
-
type: PropType<
|
|
354
|
+
textureQuality: {
|
|
355
|
+
type: PropType<TextureQuality>;
|
|
356
|
+
default: undefined;
|
|
357
|
+
};
|
|
358
|
+
strategies: {
|
|
359
|
+
type: PropType<PolyRenderStrategiesOption>;
|
|
302
360
|
default: undefined;
|
|
303
361
|
};
|
|
304
362
|
autoCenter: {
|
|
305
363
|
type: BooleanConstructor;
|
|
306
364
|
default: boolean;
|
|
307
365
|
};
|
|
366
|
+
shadow: {
|
|
367
|
+
type: PropType<PolyShadowOptions>;
|
|
368
|
+
default: undefined;
|
|
369
|
+
};
|
|
308
370
|
class: {
|
|
309
371
|
type: StringConstructor;
|
|
310
372
|
};
|
|
@@ -331,10 +393,12 @@ declare const PolyScene: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
331
393
|
textureLighting: PolyTextureLightingMode;
|
|
332
394
|
position: Vec3;
|
|
333
395
|
scale: number | Vec3;
|
|
334
|
-
atlasScale: AtlasScale;
|
|
335
396
|
polygons: Polygon[];
|
|
336
397
|
ambientLight: PolyAmbientLight;
|
|
398
|
+
textureQuality: TextureQuality;
|
|
399
|
+
strategies: PolyRenderStrategiesOption;
|
|
337
400
|
autoCenter: boolean;
|
|
401
|
+
shadow: PolyShadowOptions;
|
|
338
402
|
rotation: Vec3;
|
|
339
403
|
debugShowLabels: boolean;
|
|
340
404
|
debugShowBackfaces: boolean;
|
|
@@ -365,6 +429,15 @@ interface PolyMeshHandle {
|
|
|
365
429
|
getRotation(): Vec3 | undefined;
|
|
366
430
|
getScale(): number | Vec3 | undefined;
|
|
367
431
|
getPolygons(): Polygon[];
|
|
432
|
+
/**
|
|
433
|
+
* Update a single polygon in place. `target` is either a polygon
|
|
434
|
+
* reference (as returned by `getPolygons()`) or its index. `partial`
|
|
435
|
+
* fields are merged onto the polygon; the mesh is then re-rendered.
|
|
436
|
+
* Skips the merge pass, so this is cheaper than replacing the
|
|
437
|
+
* `polygons` prop for targeted edits like color picker updates from
|
|
438
|
+
* an inspector UI. Silently no-ops if `target` isn't found.
|
|
439
|
+
*/
|
|
440
|
+
updatePolygon(target: Polygon | number, partial: Partial<Polygon>): void;
|
|
368
441
|
/**
|
|
369
442
|
* Re-rasterize the baked texture atlas using the mesh's current rotation.
|
|
370
443
|
*
|
|
@@ -436,8 +509,18 @@ interface PolyMeshProps extends InteractionProps {
|
|
|
436
509
|
polygons?: Polygon[];
|
|
437
510
|
autoCenter?: boolean;
|
|
438
511
|
textureLighting?: PolyTextureLightingMode;
|
|
439
|
-
/**
|
|
440
|
-
|
|
512
|
+
/** Atlas bitmap budget and CSS sprite size. `"auto"` (default) uses a
|
|
513
|
+
* device-appropriate memory budget (~4 MB mobile / ~16 MB desktop) and
|
|
514
|
+
* desktop/mobile sprite sizing. Numeric values 0.1..1 force an explicit
|
|
515
|
+
* raster scale and the 64px sprite. */
|
|
516
|
+
textureQuality?: TextureQuality;
|
|
517
|
+
/**
|
|
518
|
+
* When `true` and the scene is in dynamic lighting mode, the renderer emits
|
|
519
|
+
* a flat shadow leaf sibling for each non-duplicate polygon. The shadow is
|
|
520
|
+
* projected onto the ground plane along the CSS-space light direction.
|
|
521
|
+
* Defaults to `false`.
|
|
522
|
+
*/
|
|
523
|
+
castShadow?: boolean;
|
|
441
524
|
class?: string;
|
|
442
525
|
position?: Vec3;
|
|
443
526
|
scale?: number | Vec3;
|
|
@@ -468,10 +551,14 @@ declare const PolyMesh: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
468
551
|
type: PropType<PolyTextureLightingMode>;
|
|
469
552
|
default: undefined;
|
|
470
553
|
};
|
|
471
|
-
|
|
472
|
-
type: PropType<
|
|
554
|
+
textureQuality: {
|
|
555
|
+
type: PropType<TextureQuality>;
|
|
473
556
|
default: undefined;
|
|
474
557
|
};
|
|
558
|
+
castShadow: {
|
|
559
|
+
type: PropType<boolean>;
|
|
560
|
+
default: boolean;
|
|
561
|
+
};
|
|
475
562
|
class: {
|
|
476
563
|
type: StringConstructor;
|
|
477
564
|
};
|
|
@@ -562,10 +649,14 @@ declare const PolyMesh: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
562
649
|
type: PropType<PolyTextureLightingMode>;
|
|
563
650
|
default: undefined;
|
|
564
651
|
};
|
|
565
|
-
|
|
566
|
-
type: PropType<
|
|
652
|
+
textureQuality: {
|
|
653
|
+
type: PropType<TextureQuality>;
|
|
567
654
|
default: undefined;
|
|
568
655
|
};
|
|
656
|
+
castShadow: {
|
|
657
|
+
type: PropType<boolean>;
|
|
658
|
+
default: boolean;
|
|
659
|
+
};
|
|
569
660
|
class: {
|
|
570
661
|
type: StringConstructor;
|
|
571
662
|
};
|
|
@@ -635,13 +726,14 @@ declare const PolyMesh: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
635
726
|
textureLighting: PolyTextureLightingMode;
|
|
636
727
|
position: Vec3;
|
|
637
728
|
scale: number | Vec3;
|
|
638
|
-
atlasScale: AtlasScale;
|
|
639
729
|
polygons: Polygon[];
|
|
730
|
+
textureQuality: TextureQuality;
|
|
640
731
|
autoCenter: boolean;
|
|
641
732
|
rotation: Vec3;
|
|
642
733
|
id: string;
|
|
643
734
|
src: string;
|
|
644
735
|
mtl: string;
|
|
736
|
+
castShadow: boolean;
|
|
645
737
|
onContextMenu: PolyEventHandler<MouseEvent>;
|
|
646
738
|
onDoubleClick: PolyEventHandler<MouseEvent>;
|
|
647
739
|
onPointerDown: PolyEventHandler<PointerEvent>;
|
|
@@ -654,6 +746,70 @@ declare const PolyMesh: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
654
746
|
onPointerCancel: PolyEventHandler<PointerEvent>;
|
|
655
747
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
656
748
|
|
|
749
|
+
interface PolyGroundProps {
|
|
750
|
+
/** Side length of the ground quad in world units. Default `6`. */
|
|
751
|
+
size?: number;
|
|
752
|
+
/** World-space Z (floor height). Default `0`. */
|
|
753
|
+
z?: number;
|
|
754
|
+
/** World-space XY center. Default `[0, 0]`. */
|
|
755
|
+
center?: [number, number];
|
|
756
|
+
/** Fill color. Default `#7d848e` — medium gray, chosen so 25% black `<q>`
|
|
757
|
+
* shadow leaves on top have visible contrast against it. */
|
|
758
|
+
color?: string;
|
|
759
|
+
class?: string;
|
|
760
|
+
}
|
|
761
|
+
declare const PolyGround: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
762
|
+
size: {
|
|
763
|
+
type: NumberConstructor;
|
|
764
|
+
default: number;
|
|
765
|
+
};
|
|
766
|
+
z: {
|
|
767
|
+
type: NumberConstructor;
|
|
768
|
+
default: number;
|
|
769
|
+
};
|
|
770
|
+
center: {
|
|
771
|
+
type: PropType<[number, number]>;
|
|
772
|
+
default: () => number[];
|
|
773
|
+
};
|
|
774
|
+
color: {
|
|
775
|
+
type: StringConstructor;
|
|
776
|
+
default: string;
|
|
777
|
+
};
|
|
778
|
+
class: {
|
|
779
|
+
type: StringConstructor;
|
|
780
|
+
default: undefined;
|
|
781
|
+
};
|
|
782
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
783
|
+
[key: string]: any;
|
|
784
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
785
|
+
size: {
|
|
786
|
+
type: NumberConstructor;
|
|
787
|
+
default: number;
|
|
788
|
+
};
|
|
789
|
+
z: {
|
|
790
|
+
type: NumberConstructor;
|
|
791
|
+
default: number;
|
|
792
|
+
};
|
|
793
|
+
center: {
|
|
794
|
+
type: PropType<[number, number]>;
|
|
795
|
+
default: () => number[];
|
|
796
|
+
};
|
|
797
|
+
color: {
|
|
798
|
+
type: StringConstructor;
|
|
799
|
+
default: string;
|
|
800
|
+
};
|
|
801
|
+
class: {
|
|
802
|
+
type: StringConstructor;
|
|
803
|
+
default: undefined;
|
|
804
|
+
};
|
|
805
|
+
}>> & Readonly<{}>, {
|
|
806
|
+
class: string;
|
|
807
|
+
color: string;
|
|
808
|
+
size: number;
|
|
809
|
+
center: [number, number];
|
|
810
|
+
z: number;
|
|
811
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
812
|
+
|
|
657
813
|
interface UseSceneContextOptions {
|
|
658
814
|
directionalLight?: PolyDirectionalLight;
|
|
659
815
|
}
|
|
@@ -705,7 +861,7 @@ interface PolyContext {
|
|
|
705
861
|
layerElevation?: number;
|
|
706
862
|
directionalLight?: PolyDirectionalLight;
|
|
707
863
|
textureLighting?: PolyTextureLightingMode;
|
|
708
|
-
|
|
864
|
+
textureQuality?: TextureQuality;
|
|
709
865
|
debugShowBackfaces?: boolean;
|
|
710
866
|
[key: string]: unknown;
|
|
711
867
|
}
|
|
@@ -724,8 +880,9 @@ interface PolyProps {
|
|
|
724
880
|
rotation?: Vec3;
|
|
725
881
|
context?: PolyContext;
|
|
726
882
|
textureLighting?: PolyTextureLightingMode;
|
|
727
|
-
/**
|
|
728
|
-
|
|
883
|
+
/** Atlas bitmap budget and CSS sprite size. `"auto"` (default) uses a
|
|
884
|
+
* device-appropriate memory budget and desktop/mobile sprite sizing. */
|
|
885
|
+
textureQuality?: TextureQuality;
|
|
729
886
|
baseColor?: string;
|
|
730
887
|
pointerEvents?: "auto" | "none";
|
|
731
888
|
}
|
|
@@ -768,8 +925,8 @@ declare const Poly: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
768
925
|
type: PropType<PolyTextureLightingMode>;
|
|
769
926
|
default: undefined;
|
|
770
927
|
};
|
|
771
|
-
|
|
772
|
-
type: PropType<
|
|
928
|
+
textureQuality: {
|
|
929
|
+
type: PropType<TextureQuality>;
|
|
773
930
|
default: undefined;
|
|
774
931
|
};
|
|
775
932
|
context: {
|
|
@@ -824,8 +981,8 @@ declare const Poly: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
824
981
|
type: PropType<PolyTextureLightingMode>;
|
|
825
982
|
default: undefined;
|
|
826
983
|
};
|
|
827
|
-
|
|
828
|
-
type: PropType<
|
|
984
|
+
textureQuality: {
|
|
985
|
+
type: PropType<TextureQuality>;
|
|
829
986
|
default: undefined;
|
|
830
987
|
};
|
|
831
988
|
context: {
|
|
@@ -846,7 +1003,7 @@ declare const Poly: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
846
1003
|
textureLighting: PolyTextureLightingMode;
|
|
847
1004
|
position: Vec3;
|
|
848
1005
|
scale: number | Vec3;
|
|
849
|
-
|
|
1006
|
+
textureQuality: TextureQuality;
|
|
850
1007
|
rotation: Vec3;
|
|
851
1008
|
material: PolyMaterial;
|
|
852
1009
|
context: PolyContext;
|
|
@@ -1215,8 +1372,8 @@ declare const PolyTransformControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1215
1372
|
}>, {
|
|
1216
1373
|
object: PolyTransformControlsObject;
|
|
1217
1374
|
mode: "rotate" | "translate";
|
|
1218
|
-
space: "local" | "world";
|
|
1219
1375
|
size: number;
|
|
1376
|
+
space: "local" | "world";
|
|
1220
1377
|
enabled: boolean;
|
|
1221
1378
|
showX: boolean;
|
|
1222
1379
|
showY: boolean;
|
|
@@ -1225,6 +1382,211 @@ declare const PolyTransformControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
|
1225
1382
|
rotationSnap: number | null;
|
|
1226
1383
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1227
1384
|
|
|
1385
|
+
interface PolyFirstPersonControlsOptions {
|
|
1386
|
+
/** Master switch. When `false`, all sub-controls are inert. Default: `true`. */
|
|
1387
|
+
enabled?: boolean;
|
|
1388
|
+
/** Pointer-lock mouselook (rotX = pitch, rotY = yaw). Default: `true`. */
|
|
1389
|
+
lookEnabled?: boolean;
|
|
1390
|
+
/** WASD / arrow-key planar movement on world XY. Default: `true`. */
|
|
1391
|
+
moveEnabled?: boolean;
|
|
1392
|
+
/** Space-bar parametric jump arc on world Z. Default: `true`. */
|
|
1393
|
+
jumpEnabled?: boolean;
|
|
1394
|
+
/** Ctrl crouch (lowers eye height while held). Default: `true`. */
|
|
1395
|
+
crouchEnabled?: boolean;
|
|
1396
|
+
/** Mouselook sensitivity in degrees per pixel. Default: `0.15`. */
|
|
1397
|
+
lookSensitivity?: number;
|
|
1398
|
+
/** Invert vertical mouselook. Default: `false`. */
|
|
1399
|
+
invertY?: boolean;
|
|
1400
|
+
/** Movement speed in world units per second. Default: `5`. */
|
|
1401
|
+
moveSpeed?: number;
|
|
1402
|
+
/** Initial vertical velocity for a jump, world units per second. Default: `7`. */
|
|
1403
|
+
jumpVelocity?: number;
|
|
1404
|
+
/** Gravity acceleration in world units per second squared. Default: `18`. */
|
|
1405
|
+
gravity?: number;
|
|
1406
|
+
/** Standing eye height above the ground plane. Default: `1.7`. */
|
|
1407
|
+
eyeHeight?: number;
|
|
1408
|
+
/** Eye height while crouching. Default: `1`. */
|
|
1409
|
+
crouchHeight?: number;
|
|
1410
|
+
/** World Z of the ground plane the player walks on. Default: `0`. */
|
|
1411
|
+
groundZ?: number;
|
|
1412
|
+
/** Min pitch (rotX) angle in degrees. Default: `5`. */
|
|
1413
|
+
minPitch?: number;
|
|
1414
|
+
/** Max pitch (rotX) angle in degrees. Default: `175`. */
|
|
1415
|
+
maxPitch?: number;
|
|
1416
|
+
}
|
|
1417
|
+
interface PolyFirstPersonControlsHandle {
|
|
1418
|
+
update(partial: PolyFirstPersonControlsOptions): void;
|
|
1419
|
+
resume(): void;
|
|
1420
|
+
pause(): void;
|
|
1421
|
+
destroy(): void;
|
|
1422
|
+
/** Request pointer-lock now. Call from a user gesture (click). */
|
|
1423
|
+
lock(): void;
|
|
1424
|
+
/** Release pointer-lock. */
|
|
1425
|
+
unlock(): void;
|
|
1426
|
+
/** Whether pointer-lock is currently held. */
|
|
1427
|
+
isLocked(): boolean;
|
|
1428
|
+
/**
|
|
1429
|
+
* The camera's WORLD position (the eye). Snapshot — mutate via WASD /
|
|
1430
|
+
* jump / crouch, or by calling `setOrigin`.
|
|
1431
|
+
*/
|
|
1432
|
+
getOrigin(): [number, number, number];
|
|
1433
|
+
/**
|
|
1434
|
+
* Move the camera origin to a specific world position. Re-derives the
|
|
1435
|
+
* scene's target so the perspective viewer follows.
|
|
1436
|
+
*/
|
|
1437
|
+
setOrigin(origin: [number, number, number]): void;
|
|
1438
|
+
addEventListener(type: "change" | "start" | "end", listener: () => void): void;
|
|
1439
|
+
removeEventListener(type: "change" | "start" | "end", listener: () => void): void;
|
|
1440
|
+
hasEventListener(type: "change" | "start" | "end", listener: () => void): boolean;
|
|
1441
|
+
}
|
|
1442
|
+
declare const PolyFirstPersonControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
1443
|
+
enabled: {
|
|
1444
|
+
type: BooleanConstructor;
|
|
1445
|
+
default: boolean;
|
|
1446
|
+
};
|
|
1447
|
+
lookEnabled: {
|
|
1448
|
+
type: BooleanConstructor;
|
|
1449
|
+
default: boolean;
|
|
1450
|
+
};
|
|
1451
|
+
moveEnabled: {
|
|
1452
|
+
type: BooleanConstructor;
|
|
1453
|
+
default: boolean;
|
|
1454
|
+
};
|
|
1455
|
+
jumpEnabled: {
|
|
1456
|
+
type: BooleanConstructor;
|
|
1457
|
+
default: boolean;
|
|
1458
|
+
};
|
|
1459
|
+
crouchEnabled: {
|
|
1460
|
+
type: BooleanConstructor;
|
|
1461
|
+
default: boolean;
|
|
1462
|
+
};
|
|
1463
|
+
lookSensitivity: {
|
|
1464
|
+
type: NumberConstructor;
|
|
1465
|
+
default: number;
|
|
1466
|
+
};
|
|
1467
|
+
invertY: {
|
|
1468
|
+
type: BooleanConstructor;
|
|
1469
|
+
default: boolean;
|
|
1470
|
+
};
|
|
1471
|
+
moveSpeed: {
|
|
1472
|
+
type: NumberConstructor;
|
|
1473
|
+
default: number;
|
|
1474
|
+
};
|
|
1475
|
+
jumpVelocity: {
|
|
1476
|
+
type: NumberConstructor;
|
|
1477
|
+
default: number;
|
|
1478
|
+
};
|
|
1479
|
+
gravity: {
|
|
1480
|
+
type: NumberConstructor;
|
|
1481
|
+
default: number;
|
|
1482
|
+
};
|
|
1483
|
+
eyeHeight: {
|
|
1484
|
+
type: NumberConstructor;
|
|
1485
|
+
default: number;
|
|
1486
|
+
};
|
|
1487
|
+
crouchHeight: {
|
|
1488
|
+
type: NumberConstructor;
|
|
1489
|
+
default: number;
|
|
1490
|
+
};
|
|
1491
|
+
groundZ: {
|
|
1492
|
+
type: NumberConstructor;
|
|
1493
|
+
default: number;
|
|
1494
|
+
};
|
|
1495
|
+
minPitch: {
|
|
1496
|
+
type: NumberConstructor;
|
|
1497
|
+
default: number;
|
|
1498
|
+
};
|
|
1499
|
+
maxPitch: {
|
|
1500
|
+
type: NumberConstructor;
|
|
1501
|
+
default: number;
|
|
1502
|
+
};
|
|
1503
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
1504
|
+
change: (_origin: [number, number, number]) => true;
|
|
1505
|
+
"interaction-start": (_origin: [number, number, number]) => true;
|
|
1506
|
+
"interaction-end": (_origin: [number, number, number]) => true;
|
|
1507
|
+
}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
1508
|
+
enabled: {
|
|
1509
|
+
type: BooleanConstructor;
|
|
1510
|
+
default: boolean;
|
|
1511
|
+
};
|
|
1512
|
+
lookEnabled: {
|
|
1513
|
+
type: BooleanConstructor;
|
|
1514
|
+
default: boolean;
|
|
1515
|
+
};
|
|
1516
|
+
moveEnabled: {
|
|
1517
|
+
type: BooleanConstructor;
|
|
1518
|
+
default: boolean;
|
|
1519
|
+
};
|
|
1520
|
+
jumpEnabled: {
|
|
1521
|
+
type: BooleanConstructor;
|
|
1522
|
+
default: boolean;
|
|
1523
|
+
};
|
|
1524
|
+
crouchEnabled: {
|
|
1525
|
+
type: BooleanConstructor;
|
|
1526
|
+
default: boolean;
|
|
1527
|
+
};
|
|
1528
|
+
lookSensitivity: {
|
|
1529
|
+
type: NumberConstructor;
|
|
1530
|
+
default: number;
|
|
1531
|
+
};
|
|
1532
|
+
invertY: {
|
|
1533
|
+
type: BooleanConstructor;
|
|
1534
|
+
default: boolean;
|
|
1535
|
+
};
|
|
1536
|
+
moveSpeed: {
|
|
1537
|
+
type: NumberConstructor;
|
|
1538
|
+
default: number;
|
|
1539
|
+
};
|
|
1540
|
+
jumpVelocity: {
|
|
1541
|
+
type: NumberConstructor;
|
|
1542
|
+
default: number;
|
|
1543
|
+
};
|
|
1544
|
+
gravity: {
|
|
1545
|
+
type: NumberConstructor;
|
|
1546
|
+
default: number;
|
|
1547
|
+
};
|
|
1548
|
+
eyeHeight: {
|
|
1549
|
+
type: NumberConstructor;
|
|
1550
|
+
default: number;
|
|
1551
|
+
};
|
|
1552
|
+
crouchHeight: {
|
|
1553
|
+
type: NumberConstructor;
|
|
1554
|
+
default: number;
|
|
1555
|
+
};
|
|
1556
|
+
groundZ: {
|
|
1557
|
+
type: NumberConstructor;
|
|
1558
|
+
default: number;
|
|
1559
|
+
};
|
|
1560
|
+
minPitch: {
|
|
1561
|
+
type: NumberConstructor;
|
|
1562
|
+
default: number;
|
|
1563
|
+
};
|
|
1564
|
+
maxPitch: {
|
|
1565
|
+
type: NumberConstructor;
|
|
1566
|
+
default: number;
|
|
1567
|
+
};
|
|
1568
|
+
}>> & Readonly<{
|
|
1569
|
+
onChange?: ((_origin: [number, number, number]) => any) | undefined;
|
|
1570
|
+
"onInteraction-start"?: ((_origin: [number, number, number]) => any) | undefined;
|
|
1571
|
+
"onInteraction-end"?: ((_origin: [number, number, number]) => any) | undefined;
|
|
1572
|
+
}>, {
|
|
1573
|
+
enabled: boolean;
|
|
1574
|
+
lookEnabled: boolean;
|
|
1575
|
+
moveEnabled: boolean;
|
|
1576
|
+
jumpEnabled: boolean;
|
|
1577
|
+
crouchEnabled: boolean;
|
|
1578
|
+
lookSensitivity: number;
|
|
1579
|
+
invertY: boolean;
|
|
1580
|
+
moveSpeed: number;
|
|
1581
|
+
jumpVelocity: number;
|
|
1582
|
+
gravity: number;
|
|
1583
|
+
eyeHeight: number;
|
|
1584
|
+
crouchHeight: number;
|
|
1585
|
+
groundZ: number;
|
|
1586
|
+
minPitch: number;
|
|
1587
|
+
maxPitch: number;
|
|
1588
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
1589
|
+
|
|
1228
1590
|
interface PolySelectProps {
|
|
1229
1591
|
multiple?: boolean;
|
|
1230
1592
|
clearOnMiss?: boolean;
|
|
@@ -1436,4 +1798,4 @@ interface UsePolyAnimationResultVue {
|
|
|
1436
1798
|
}
|
|
1437
1799
|
declare function usePolyAnimation(clips: MaybeRef<PolyAnimationClip[] | undefined>, controller: MaybeRef<ParseAnimationController | undefined>, root?: MaybeRef<PolyAnimationTarget | null | undefined>): UsePolyAnimationResultVue;
|
|
1438
1800
|
|
|
1439
|
-
export { type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyPerspectiveCamera as PolyCamera, PolyCameraContextKey, type PolyCameraContextValue, type PolyPerspectiveCameraProps as PolyCameraProps, type PolyContext, type PolyControlsAnimateOptions, PolyDirectionalLightHelper, type PolyDirectionalLightHelperProps, type PolyEventHandler, PolyMapControls, type PolyMapControlsCamera, type PolyMapControlsProps, PolyMesh, type PolyMeshHandle, type PolyMeshProps, type PolyMouseEvent, PolyOrbitControls, type PolyOrbitControlsCamera, type PolyOrbitControlsProps, PolyOrthographicCamera, type PolyOrthographicCameraProps, PolyPerspectiveCamera, type PolyPerspectiveCameraProps, type PolyPointerEvent, type PolyProps, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, PolySelectionContextKey, PolyTransformControls, type PolyTransformControlsObject, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsProps, type PolyWheelEvent, type UseCameraOptions, type UseCameraResult, type UseMeshOptions, type UseMeshResult, type UsePolyAnimationResultVue, type UseSceneContextOptions, type UseSceneContextResult, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|
|
1801
|
+
export { type InteractionProps, Poly, PolyAxesHelper, type PolyAxesHelperProps, PolyPerspectiveCamera as PolyCamera, PolyCameraContextKey, type PolyCameraContextValue, type PolyPerspectiveCameraProps as PolyCameraProps, type PolyContext, type PolyControlsAnimateOptions, PolyDirectionalLightHelper, type PolyDirectionalLightHelperProps, type PolyEventHandler, PolyFirstPersonControls, type PolyFirstPersonControlsHandle, type PolyFirstPersonControlsOptions, PolyGround, type PolyGroundProps, PolyMapControls, type PolyMapControlsCamera, type PolyMapControlsProps, PolyMesh, type PolyMeshHandle, type PolyMeshProps, type PolyMouseEvent, PolyOrbitControls, type PolyOrbitControlsCamera, type PolyOrbitControlsProps, PolyOrthographicCamera, type PolyOrthographicCameraProps, PolyPerspectiveCamera, type PolyPerspectiveCameraProps, type PolyPointerEvent, type PolyProps, type PolyRenderStrategiesOption, type PolyRenderStrategy, PolyScene, type PolySceneProps, PolySelect, type PolySelectProps, type PolySelectionApi, PolySelectionContextKey, PolyTransformControls, type PolyTransformControlsObject, type PolyTransformControlsObjectChangeEvent, type PolyTransformControlsProps, type PolyWheelEvent, type UseCameraOptions, type UseCameraResult, type UseMeshOptions, type UseMeshResult, type UsePolyAnimationResultVue, type UseSceneContextOptions, type UseSceneContextResult, findMeshUnderPoint, findPolyMeshHandle, injectPolyBaseStyles, pointInMeshElement, usePolyAnimation, usePolyCamera, usePolyMaterial, usePolyMesh, usePolySceneContext, usePolySelect, usePolySelectionApi };
|