@glyphcss/vue 0.0.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/LICENSE +21 -0
- package/README.md +81 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +600 -0
- package/dist/index.d.ts +600 -0
- package/dist/index.js +1 -0
- package/package.json +63 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,600 @@
|
|
|
1
|
+
import { RenderMode, Vec3, GlyphcssAnimationTarget, GlyphcssAnimationMixer, GlyphcssAnimationClip, GlyphcssAnimationAction, ParseAnimationController } from '@glyphcss/core';
|
|
2
|
+
export { ApproximateMergeOptions, ArrowPolygonsOptions, AutoRotateConfig, AutoRotateOption, AxesHelperOptions, BASE_TILE, CAMERA_BACKFACE_CULL_EPS, CameraCullNormalGroup, CameraCullRotation, CameraHandle, CameraState, CameraStyleInput, CoverPlanarPolygonsOptions, CullInteriorOptions, DEFAULT_CAMERA_STATE, DEFAULT_PROJECTION, GltfParseOptions, GlyphcssAmbientLight, GlyphcssAnimationAction, GlyphcssAnimationClip, GlyphcssAnimationMixer, GlyphcssAnimationTarget, GlyphcssDirectionalLight, LoadMeshOptions, LoopMode, LoopOnce, LoopPingPong, LoopRepeat, MtlParseResult, NormalizeResult, ObjParseOptions, OctahedronPolygonsOptions, OptimizeMeshPolygonsOptions, ParseAnimationClip, ParseAnimationController, ParseResult, ParsedColor, Polygon, PolygonFace, RingPolygonsOptions, SceneBbox, SceneContext, SceneContextBuildArgs, SceneContextBuildResult, SolidTextureSampleOptions, TextureTriangle, VOXEL_CAMERA_CULL_AXIS_EPS, VOXEL_CAMERA_CULL_NORMAL_LIMIT, Vec2, Vec3, VoxParseOptions, arrowPolygons, axesHelperPolygons, bakeSolidTextureSampledPolygons, bakeSolidTextureSamples, buildSceneContext, cameraCullNormalGroups, cameraCullNormalGroupsFromPolygons, cameraCullNormalKey, cameraCullVisibleSignature, cameraFacingDepth, clampChannel, computeSceneBbox, computeShapeLighting, coverPlanarPolygons, createGlyphcssAnimationMixer, createIsometricCamera, 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 '@glyphcss/core';
|
|
3
|
+
import * as vue from 'vue';
|
|
4
|
+
import { PropType, InjectionKey, ShallowRef, Ref, ComputedRef, MaybeRef } from 'vue';
|
|
5
|
+
import { GlyphcssDirectionalLight, GlyphcssAmbientLight, GlyphcssTriangle, GlyphcssSceneHandle, GlyphcssCamera } from 'glyphcss';
|
|
6
|
+
export { injectGlyphcssBaseStyles } from 'glyphcss';
|
|
7
|
+
|
|
8
|
+
interface GlyphcssSceneProps {
|
|
9
|
+
mode?: RenderMode;
|
|
10
|
+
glyphPalette?: string;
|
|
11
|
+
useColors?: boolean;
|
|
12
|
+
cols?: number;
|
|
13
|
+
rows?: number;
|
|
14
|
+
cellAspect?: number;
|
|
15
|
+
directionalLight?: GlyphcssDirectionalLight;
|
|
16
|
+
ambientLight?: GlyphcssAmbientLight;
|
|
17
|
+
class?: string;
|
|
18
|
+
}
|
|
19
|
+
declare const GlyphcssScene: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
20
|
+
mode: {
|
|
21
|
+
type: PropType<RenderMode>;
|
|
22
|
+
default: undefined;
|
|
23
|
+
};
|
|
24
|
+
glyphPalette: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: undefined;
|
|
27
|
+
};
|
|
28
|
+
useColors: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: undefined;
|
|
31
|
+
};
|
|
32
|
+
cols: {
|
|
33
|
+
type: NumberConstructor;
|
|
34
|
+
default: undefined;
|
|
35
|
+
};
|
|
36
|
+
rows: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
default: undefined;
|
|
39
|
+
};
|
|
40
|
+
cellAspect: {
|
|
41
|
+
type: NumberConstructor;
|
|
42
|
+
default: undefined;
|
|
43
|
+
};
|
|
44
|
+
directionalLight: {
|
|
45
|
+
type: PropType<GlyphcssDirectionalLight>;
|
|
46
|
+
default: undefined;
|
|
47
|
+
};
|
|
48
|
+
ambientLight: {
|
|
49
|
+
type: PropType<GlyphcssAmbientLight>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
};
|
|
52
|
+
class: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: undefined;
|
|
55
|
+
};
|
|
56
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
59
|
+
mode: {
|
|
60
|
+
type: PropType<RenderMode>;
|
|
61
|
+
default: undefined;
|
|
62
|
+
};
|
|
63
|
+
glyphPalette: {
|
|
64
|
+
type: StringConstructor;
|
|
65
|
+
default: undefined;
|
|
66
|
+
};
|
|
67
|
+
useColors: {
|
|
68
|
+
type: BooleanConstructor;
|
|
69
|
+
default: undefined;
|
|
70
|
+
};
|
|
71
|
+
cols: {
|
|
72
|
+
type: NumberConstructor;
|
|
73
|
+
default: undefined;
|
|
74
|
+
};
|
|
75
|
+
rows: {
|
|
76
|
+
type: NumberConstructor;
|
|
77
|
+
default: undefined;
|
|
78
|
+
};
|
|
79
|
+
cellAspect: {
|
|
80
|
+
type: NumberConstructor;
|
|
81
|
+
default: undefined;
|
|
82
|
+
};
|
|
83
|
+
directionalLight: {
|
|
84
|
+
type: PropType<GlyphcssDirectionalLight>;
|
|
85
|
+
default: undefined;
|
|
86
|
+
};
|
|
87
|
+
ambientLight: {
|
|
88
|
+
type: PropType<GlyphcssAmbientLight>;
|
|
89
|
+
default: undefined;
|
|
90
|
+
};
|
|
91
|
+
class: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: undefined;
|
|
94
|
+
};
|
|
95
|
+
}>> & Readonly<{}>, {
|
|
96
|
+
mode: RenderMode;
|
|
97
|
+
glyphPalette: string;
|
|
98
|
+
useColors: boolean;
|
|
99
|
+
cols: number;
|
|
100
|
+
rows: number;
|
|
101
|
+
cellAspect: number;
|
|
102
|
+
directionalLight: GlyphcssDirectionalLight;
|
|
103
|
+
ambientLight: GlyphcssAmbientLight;
|
|
104
|
+
class: string;
|
|
105
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
106
|
+
|
|
107
|
+
interface GlyphcssMeshProps {
|
|
108
|
+
id?: string;
|
|
109
|
+
triangles?: GlyphcssTriangle[];
|
|
110
|
+
position?: Vec3;
|
|
111
|
+
scale?: number | Vec3;
|
|
112
|
+
rotation?: Vec3;
|
|
113
|
+
class?: string;
|
|
114
|
+
}
|
|
115
|
+
declare const GlyphcssMesh: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
116
|
+
id: {
|
|
117
|
+
type: StringConstructor;
|
|
118
|
+
default: undefined;
|
|
119
|
+
};
|
|
120
|
+
triangles: {
|
|
121
|
+
type: PropType<GlyphcssTriangle[]>;
|
|
122
|
+
default: () => never[];
|
|
123
|
+
};
|
|
124
|
+
position: {
|
|
125
|
+
type: PropType<Vec3>;
|
|
126
|
+
default: undefined;
|
|
127
|
+
};
|
|
128
|
+
scale: {
|
|
129
|
+
type: PropType<number | Vec3>;
|
|
130
|
+
default: undefined;
|
|
131
|
+
};
|
|
132
|
+
rotation: {
|
|
133
|
+
type: PropType<Vec3>;
|
|
134
|
+
default: undefined;
|
|
135
|
+
};
|
|
136
|
+
class: {
|
|
137
|
+
type: StringConstructor;
|
|
138
|
+
default: undefined;
|
|
139
|
+
};
|
|
140
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
141
|
+
[key: string]: any;
|
|
142
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
143
|
+
id: {
|
|
144
|
+
type: StringConstructor;
|
|
145
|
+
default: undefined;
|
|
146
|
+
};
|
|
147
|
+
triangles: {
|
|
148
|
+
type: PropType<GlyphcssTriangle[]>;
|
|
149
|
+
default: () => never[];
|
|
150
|
+
};
|
|
151
|
+
position: {
|
|
152
|
+
type: PropType<Vec3>;
|
|
153
|
+
default: undefined;
|
|
154
|
+
};
|
|
155
|
+
scale: {
|
|
156
|
+
type: PropType<number | Vec3>;
|
|
157
|
+
default: undefined;
|
|
158
|
+
};
|
|
159
|
+
rotation: {
|
|
160
|
+
type: PropType<Vec3>;
|
|
161
|
+
default: undefined;
|
|
162
|
+
};
|
|
163
|
+
class: {
|
|
164
|
+
type: StringConstructor;
|
|
165
|
+
default: undefined;
|
|
166
|
+
};
|
|
167
|
+
}>> & Readonly<{}>, {
|
|
168
|
+
class: string;
|
|
169
|
+
id: string;
|
|
170
|
+
triangles: GlyphcssTriangle[];
|
|
171
|
+
position: Vec3;
|
|
172
|
+
scale: number | Vec3;
|
|
173
|
+
rotation: Vec3;
|
|
174
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
175
|
+
|
|
176
|
+
interface GlyphcssHotspotProps {
|
|
177
|
+
id: string;
|
|
178
|
+
at: Vec3;
|
|
179
|
+
size?: [number, number];
|
|
180
|
+
}
|
|
181
|
+
declare const GlyphcssHotspot: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
182
|
+
id: {
|
|
183
|
+
type: StringConstructor;
|
|
184
|
+
required: true;
|
|
185
|
+
};
|
|
186
|
+
at: {
|
|
187
|
+
type: PropType<Vec3>;
|
|
188
|
+
required: true;
|
|
189
|
+
};
|
|
190
|
+
size: {
|
|
191
|
+
type: PropType<[number, number]>;
|
|
192
|
+
default: undefined;
|
|
193
|
+
};
|
|
194
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, "click"[], "click", vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
195
|
+
id: {
|
|
196
|
+
type: StringConstructor;
|
|
197
|
+
required: true;
|
|
198
|
+
};
|
|
199
|
+
at: {
|
|
200
|
+
type: PropType<Vec3>;
|
|
201
|
+
required: true;
|
|
202
|
+
};
|
|
203
|
+
size: {
|
|
204
|
+
type: PropType<[number, number]>;
|
|
205
|
+
default: undefined;
|
|
206
|
+
};
|
|
207
|
+
}>> & Readonly<{
|
|
208
|
+
onClick?: ((...args: any[]) => any) | undefined;
|
|
209
|
+
}>, {
|
|
210
|
+
size: [number, number];
|
|
211
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
212
|
+
|
|
213
|
+
interface GlyphcssSceneContextValue {
|
|
214
|
+
sceneRef: ShallowRef<GlyphcssSceneHandle | null>;
|
|
215
|
+
}
|
|
216
|
+
declare const GlyphcssSceneContextKey: InjectionKey<GlyphcssSceneContextValue>;
|
|
217
|
+
|
|
218
|
+
declare function useGlyphcssSceneContext(): GlyphcssSceneContextValue;
|
|
219
|
+
|
|
220
|
+
interface GlyphcssPerspectiveCameraProps {
|
|
221
|
+
rotX?: number;
|
|
222
|
+
rotY?: number;
|
|
223
|
+
distance?: number;
|
|
224
|
+
scale?: number;
|
|
225
|
+
stretch?: number;
|
|
226
|
+
center?: [number, number];
|
|
227
|
+
}
|
|
228
|
+
declare const GlyphcssPerspectiveCamera: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
229
|
+
rotX: {
|
|
230
|
+
type: NumberConstructor;
|
|
231
|
+
default: undefined;
|
|
232
|
+
};
|
|
233
|
+
rotY: {
|
|
234
|
+
type: NumberConstructor;
|
|
235
|
+
default: undefined;
|
|
236
|
+
};
|
|
237
|
+
distance: {
|
|
238
|
+
type: NumberConstructor;
|
|
239
|
+
default: undefined;
|
|
240
|
+
};
|
|
241
|
+
scale: {
|
|
242
|
+
type: NumberConstructor;
|
|
243
|
+
default: undefined;
|
|
244
|
+
};
|
|
245
|
+
stretch: {
|
|
246
|
+
type: NumberConstructor;
|
|
247
|
+
default: undefined;
|
|
248
|
+
};
|
|
249
|
+
center: {
|
|
250
|
+
type: PropType<[number, number]>;
|
|
251
|
+
default: undefined;
|
|
252
|
+
};
|
|
253
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
254
|
+
[key: string]: any;
|
|
255
|
+
}>[] | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
256
|
+
rotX: {
|
|
257
|
+
type: NumberConstructor;
|
|
258
|
+
default: undefined;
|
|
259
|
+
};
|
|
260
|
+
rotY: {
|
|
261
|
+
type: NumberConstructor;
|
|
262
|
+
default: undefined;
|
|
263
|
+
};
|
|
264
|
+
distance: {
|
|
265
|
+
type: NumberConstructor;
|
|
266
|
+
default: undefined;
|
|
267
|
+
};
|
|
268
|
+
scale: {
|
|
269
|
+
type: NumberConstructor;
|
|
270
|
+
default: undefined;
|
|
271
|
+
};
|
|
272
|
+
stretch: {
|
|
273
|
+
type: NumberConstructor;
|
|
274
|
+
default: undefined;
|
|
275
|
+
};
|
|
276
|
+
center: {
|
|
277
|
+
type: PropType<[number, number]>;
|
|
278
|
+
default: undefined;
|
|
279
|
+
};
|
|
280
|
+
}>> & Readonly<{}>, {
|
|
281
|
+
scale: number;
|
|
282
|
+
rotX: number;
|
|
283
|
+
rotY: number;
|
|
284
|
+
distance: number;
|
|
285
|
+
stretch: number;
|
|
286
|
+
center: [number, number];
|
|
287
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
288
|
+
|
|
289
|
+
interface GlyphcssOrthographicCameraProps {
|
|
290
|
+
rotX?: number;
|
|
291
|
+
rotY?: number;
|
|
292
|
+
zoom?: number;
|
|
293
|
+
center?: [number, number];
|
|
294
|
+
}
|
|
295
|
+
declare const GlyphcssOrthographicCamera: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
296
|
+
rotX: {
|
|
297
|
+
type: NumberConstructor;
|
|
298
|
+
default: undefined;
|
|
299
|
+
};
|
|
300
|
+
rotY: {
|
|
301
|
+
type: NumberConstructor;
|
|
302
|
+
default: undefined;
|
|
303
|
+
};
|
|
304
|
+
zoom: {
|
|
305
|
+
type: NumberConstructor;
|
|
306
|
+
default: undefined;
|
|
307
|
+
};
|
|
308
|
+
center: {
|
|
309
|
+
type: PropType<[number, number]>;
|
|
310
|
+
default: undefined;
|
|
311
|
+
};
|
|
312
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
|
313
|
+
[key: string]: any;
|
|
314
|
+
}>[] | null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
315
|
+
rotX: {
|
|
316
|
+
type: NumberConstructor;
|
|
317
|
+
default: undefined;
|
|
318
|
+
};
|
|
319
|
+
rotY: {
|
|
320
|
+
type: NumberConstructor;
|
|
321
|
+
default: undefined;
|
|
322
|
+
};
|
|
323
|
+
zoom: {
|
|
324
|
+
type: NumberConstructor;
|
|
325
|
+
default: undefined;
|
|
326
|
+
};
|
|
327
|
+
center: {
|
|
328
|
+
type: PropType<[number, number]>;
|
|
329
|
+
default: undefined;
|
|
330
|
+
};
|
|
331
|
+
}>> & Readonly<{}>, {
|
|
332
|
+
rotX: number;
|
|
333
|
+
rotY: number;
|
|
334
|
+
center: [number, number];
|
|
335
|
+
zoom: number;
|
|
336
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
337
|
+
|
|
338
|
+
interface GlyphcssCameraContextValue {
|
|
339
|
+
cameraRef: ShallowRef<GlyphcssCamera | null>;
|
|
340
|
+
rerender: () => void;
|
|
341
|
+
}
|
|
342
|
+
declare const GlyphcssCameraContextKey: InjectionKey<GlyphcssCameraContextValue>;
|
|
343
|
+
|
|
344
|
+
declare function useGlyphcssCamera(): GlyphcssCameraContextValue;
|
|
345
|
+
|
|
346
|
+
interface GlyphcssOrbitControlsProps {
|
|
347
|
+
drag?: boolean;
|
|
348
|
+
wheel?: boolean;
|
|
349
|
+
invert?: boolean | number;
|
|
350
|
+
animate?: false | {
|
|
351
|
+
speed?: number;
|
|
352
|
+
axis?: "x" | "y";
|
|
353
|
+
pauseOnInteraction?: boolean;
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
declare const GlyphcssOrbitControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
357
|
+
drag: {
|
|
358
|
+
type: BooleanConstructor;
|
|
359
|
+
default: boolean;
|
|
360
|
+
};
|
|
361
|
+
wheel: {
|
|
362
|
+
type: BooleanConstructor;
|
|
363
|
+
default: boolean;
|
|
364
|
+
};
|
|
365
|
+
invert: {
|
|
366
|
+
type: () => boolean | number;
|
|
367
|
+
default: boolean;
|
|
368
|
+
};
|
|
369
|
+
animate: {
|
|
370
|
+
type: () => false | {
|
|
371
|
+
speed?: number;
|
|
372
|
+
axis?: "x" | "y";
|
|
373
|
+
pauseOnInteraction?: boolean;
|
|
374
|
+
};
|
|
375
|
+
default: boolean;
|
|
376
|
+
};
|
|
377
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
378
|
+
drag: {
|
|
379
|
+
type: BooleanConstructor;
|
|
380
|
+
default: boolean;
|
|
381
|
+
};
|
|
382
|
+
wheel: {
|
|
383
|
+
type: BooleanConstructor;
|
|
384
|
+
default: boolean;
|
|
385
|
+
};
|
|
386
|
+
invert: {
|
|
387
|
+
type: () => boolean | number;
|
|
388
|
+
default: boolean;
|
|
389
|
+
};
|
|
390
|
+
animate: {
|
|
391
|
+
type: () => false | {
|
|
392
|
+
speed?: number;
|
|
393
|
+
axis?: "x" | "y";
|
|
394
|
+
pauseOnInteraction?: boolean;
|
|
395
|
+
};
|
|
396
|
+
default: boolean;
|
|
397
|
+
};
|
|
398
|
+
}>> & Readonly<{}>, {
|
|
399
|
+
drag: boolean;
|
|
400
|
+
wheel: boolean;
|
|
401
|
+
invert: number | boolean;
|
|
402
|
+
animate: false | {
|
|
403
|
+
speed?: number;
|
|
404
|
+
axis?: "x" | "y";
|
|
405
|
+
pauseOnInteraction?: boolean;
|
|
406
|
+
};
|
|
407
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
408
|
+
|
|
409
|
+
interface GlyphcssMapControlsProps {
|
|
410
|
+
drag?: boolean;
|
|
411
|
+
wheel?: boolean;
|
|
412
|
+
invert?: boolean | number;
|
|
413
|
+
animate?: false | {
|
|
414
|
+
speed?: number;
|
|
415
|
+
axis?: "x" | "y";
|
|
416
|
+
pauseOnInteraction?: boolean;
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
declare const GlyphcssMapControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
420
|
+
drag: {
|
|
421
|
+
type: BooleanConstructor;
|
|
422
|
+
default: boolean;
|
|
423
|
+
};
|
|
424
|
+
wheel: {
|
|
425
|
+
type: BooleanConstructor;
|
|
426
|
+
default: boolean;
|
|
427
|
+
};
|
|
428
|
+
invert: {
|
|
429
|
+
type: () => boolean | number;
|
|
430
|
+
default: boolean;
|
|
431
|
+
};
|
|
432
|
+
animate: {
|
|
433
|
+
type: () => false | {
|
|
434
|
+
speed?: number;
|
|
435
|
+
axis?: "x" | "y";
|
|
436
|
+
pauseOnInteraction?: boolean;
|
|
437
|
+
};
|
|
438
|
+
default: boolean;
|
|
439
|
+
};
|
|
440
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
441
|
+
drag: {
|
|
442
|
+
type: BooleanConstructor;
|
|
443
|
+
default: boolean;
|
|
444
|
+
};
|
|
445
|
+
wheel: {
|
|
446
|
+
type: BooleanConstructor;
|
|
447
|
+
default: boolean;
|
|
448
|
+
};
|
|
449
|
+
invert: {
|
|
450
|
+
type: () => boolean | number;
|
|
451
|
+
default: boolean;
|
|
452
|
+
};
|
|
453
|
+
animate: {
|
|
454
|
+
type: () => false | {
|
|
455
|
+
speed?: number;
|
|
456
|
+
axis?: "x" | "y";
|
|
457
|
+
pauseOnInteraction?: boolean;
|
|
458
|
+
};
|
|
459
|
+
default: boolean;
|
|
460
|
+
};
|
|
461
|
+
}>> & Readonly<{}>, {
|
|
462
|
+
drag: boolean;
|
|
463
|
+
wheel: boolean;
|
|
464
|
+
invert: number | boolean;
|
|
465
|
+
animate: false | {
|
|
466
|
+
speed?: number;
|
|
467
|
+
axis?: "x" | "y";
|
|
468
|
+
pauseOnInteraction?: boolean;
|
|
469
|
+
};
|
|
470
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
471
|
+
|
|
472
|
+
interface GlyphcssFirstPersonControlsProps {
|
|
473
|
+
drag?: boolean;
|
|
474
|
+
keyboard?: boolean;
|
|
475
|
+
moveSpeed?: number;
|
|
476
|
+
lookSpeed?: number;
|
|
477
|
+
invert?: boolean | number;
|
|
478
|
+
}
|
|
479
|
+
declare const GlyphcssFirstPersonControls: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
480
|
+
drag: {
|
|
481
|
+
type: BooleanConstructor;
|
|
482
|
+
default: boolean;
|
|
483
|
+
};
|
|
484
|
+
keyboard: {
|
|
485
|
+
type: BooleanConstructor;
|
|
486
|
+
default: boolean;
|
|
487
|
+
};
|
|
488
|
+
moveSpeed: {
|
|
489
|
+
type: NumberConstructor;
|
|
490
|
+
default: number;
|
|
491
|
+
};
|
|
492
|
+
lookSpeed: {
|
|
493
|
+
type: NumberConstructor;
|
|
494
|
+
default: number;
|
|
495
|
+
};
|
|
496
|
+
invert: {
|
|
497
|
+
type: () => boolean | number;
|
|
498
|
+
default: boolean;
|
|
499
|
+
};
|
|
500
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
501
|
+
drag: {
|
|
502
|
+
type: BooleanConstructor;
|
|
503
|
+
default: boolean;
|
|
504
|
+
};
|
|
505
|
+
keyboard: {
|
|
506
|
+
type: BooleanConstructor;
|
|
507
|
+
default: boolean;
|
|
508
|
+
};
|
|
509
|
+
moveSpeed: {
|
|
510
|
+
type: NumberConstructor;
|
|
511
|
+
default: number;
|
|
512
|
+
};
|
|
513
|
+
lookSpeed: {
|
|
514
|
+
type: NumberConstructor;
|
|
515
|
+
default: number;
|
|
516
|
+
};
|
|
517
|
+
invert: {
|
|
518
|
+
type: () => boolean | number;
|
|
519
|
+
default: boolean;
|
|
520
|
+
};
|
|
521
|
+
}>> & Readonly<{}>, {
|
|
522
|
+
drag: boolean;
|
|
523
|
+
invert: number | boolean;
|
|
524
|
+
keyboard: boolean;
|
|
525
|
+
moveSpeed: number;
|
|
526
|
+
lookSpeed: number;
|
|
527
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
528
|
+
|
|
529
|
+
interface GlyphcssAxesHelperProps {
|
|
530
|
+
size?: number;
|
|
531
|
+
}
|
|
532
|
+
declare const GlyphcssAxesHelper: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
533
|
+
size: {
|
|
534
|
+
type: NumberConstructor;
|
|
535
|
+
default: number;
|
|
536
|
+
};
|
|
537
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
538
|
+
size: {
|
|
539
|
+
type: NumberConstructor;
|
|
540
|
+
default: number;
|
|
541
|
+
};
|
|
542
|
+
}>> & Readonly<{}>, {
|
|
543
|
+
size: number;
|
|
544
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
545
|
+
|
|
546
|
+
interface GlyphcssDirectionalLightHelperProps {
|
|
547
|
+
position?: Vec3;
|
|
548
|
+
color?: string;
|
|
549
|
+
size?: number;
|
|
550
|
+
}
|
|
551
|
+
declare const GlyphcssDirectionalLightHelper: vue.DefineComponent<vue.ExtractPropTypes<{
|
|
552
|
+
position: {
|
|
553
|
+
type: PropType<Vec3>;
|
|
554
|
+
default: () => number[];
|
|
555
|
+
};
|
|
556
|
+
color: {
|
|
557
|
+
type: StringConstructor;
|
|
558
|
+
default: string;
|
|
559
|
+
};
|
|
560
|
+
size: {
|
|
561
|
+
type: NumberConstructor;
|
|
562
|
+
default: number;
|
|
563
|
+
};
|
|
564
|
+
}>, () => null, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
|
565
|
+
position: {
|
|
566
|
+
type: PropType<Vec3>;
|
|
567
|
+
default: () => number[];
|
|
568
|
+
};
|
|
569
|
+
color: {
|
|
570
|
+
type: StringConstructor;
|
|
571
|
+
default: string;
|
|
572
|
+
};
|
|
573
|
+
size: {
|
|
574
|
+
type: NumberConstructor;
|
|
575
|
+
default: number;
|
|
576
|
+
};
|
|
577
|
+
}>> & Readonly<{}>, {
|
|
578
|
+
position: Vec3;
|
|
579
|
+
size: number;
|
|
580
|
+
color: string;
|
|
581
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
|
582
|
+
|
|
583
|
+
interface UseGlyphcssAnimationResultVue {
|
|
584
|
+
/** Attach to a mesh handle when not passing `root` directly. */
|
|
585
|
+
ref: Ref<GlyphcssAnimationTarget | null>;
|
|
586
|
+
/** The active mixer, or null if inputs are not ready yet. */
|
|
587
|
+
mixer: ComputedRef<GlyphcssAnimationMixer | null>;
|
|
588
|
+
/** Resolved clip list. */
|
|
589
|
+
clips: ComputedRef<GlyphcssAnimationClip[]>;
|
|
590
|
+
/** Clip names in input order. */
|
|
591
|
+
names: ComputedRef<string[]>;
|
|
592
|
+
/**
|
|
593
|
+
* Lazy action proxy keyed by clip name. Accessing `actions.value["walk"]`
|
|
594
|
+
* instantiates the action via the mixer. Returns null when mixer is null.
|
|
595
|
+
*/
|
|
596
|
+
actions: ComputedRef<Record<string, GlyphcssAnimationAction | null>>;
|
|
597
|
+
}
|
|
598
|
+
declare function useGlyphcssAnimation(clips: MaybeRef<GlyphcssAnimationClip[] | undefined>, controller: MaybeRef<ParseAnimationController | undefined>, root?: MaybeRef<GlyphcssAnimationTarget | null | undefined>): UseGlyphcssAnimationResultVue;
|
|
599
|
+
|
|
600
|
+
export { GlyphcssAxesHelper, type GlyphcssAxesHelperProps, GlyphcssPerspectiveCamera as GlyphcssCamera, GlyphcssCameraContextKey, type GlyphcssCameraContextValue, type GlyphcssPerspectiveCameraProps as GlyphcssCameraProps, GlyphcssDirectionalLightHelper, type GlyphcssDirectionalLightHelperProps, GlyphcssFirstPersonControls, type GlyphcssFirstPersonControlsProps, GlyphcssHotspot, type GlyphcssHotspotProps, GlyphcssMapControls, type GlyphcssMapControlsProps, GlyphcssMesh, type GlyphcssMeshProps, GlyphcssOrbitControls, type GlyphcssOrbitControlsProps, GlyphcssOrthographicCamera, type GlyphcssOrthographicCameraProps, GlyphcssPerspectiveCamera, type GlyphcssPerspectiveCameraProps, GlyphcssScene, GlyphcssSceneContextKey, type GlyphcssSceneContextValue, type GlyphcssSceneProps, type UseGlyphcssAnimationResultVue, useGlyphcssAnimation, useGlyphcssCamera, useGlyphcssSceneContext };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{CAMERA_BACKFACE_CULL_EPS as Ns,VOXEL_CAMERA_CULL_AXIS_EPS as zs,VOXEL_CAMERA_CULL_NORMAL_LIMIT as Ks,normalizePolygons as Xs,mergePolygons as Ys,coverPlanarPolygons as _s,optimizeMeshPolygons as Ds,cullInteriorPolygons as Is,cameraCullNormalGroups as Us,cameraCullNormalGroupsFromPolygons as qs,cameraCullNormalKey as $s,cameraCullVisibleSignature as Js,cameraFacingDepth as Ws,isAxisAlignedSurfaceNormal as Qs,isVoxelCameraCullableNormalGroups as Zs,normalFacesCamera as eo,polygonCssSurfaceNormal as to,polygonFacesCamera as so,parseObj as oo,parseMtl as no,parseGltf as ro,bakeSolidTextureSamples as lo,bakeSolidTextureSampledPolygons as ao,loadMesh as co,createIsometricCamera as io,parseVox as po,polygonFaces as uo,computeShapeLighting as mo,parseColor as yo,parsePureColor as ho,parseHexColor as fo,parseRgbColor as Go,formatColor as Co,clampChannel as go,shadeColor as vo,rotateVec3 as bo,inverseRotateVec3 as xo,axesHelperPolygons as Po,arrowPolygons as Ao,ringPolygons as So,octahedronPolygons as wo,buildSceneContext as Ro,computeSceneBbox as Oo,BASE_TILE as Mo,DEFAULT_CAMERA_STATE as Lo,DEFAULT_PROJECTION as To,normalizeInvertMultiplier as Ho,createGlyphcssAnimationMixer as Vo,LoopOnce as ko,LoopRepeat as jo,LoopPingPong as Bo}from"@glyphcss/core";import{defineComponent as X,h as Y,provide as _,shallowRef as k,onMounted as D,onBeforeUnmount as I,watch as U}from"vue";import{createGlyphcssScene as q,injectGlyphcssBaseStyles as $}from"glyphcss";var i=Symbol("glyphcss-scene");var x=X({name:"GlyphcssScene",inheritAttrs:!1,props:{mode:{type:String,default:void 0},glyphPalette:{type:String,default:void 0},useColors:{type:Boolean,default:void 0},cols:{type:Number,default:void 0},rows:{type:Number,default:void 0},cellAspect:{type:Number,default:void 0},directionalLight:{type:Object,default:void 0},ambientLight:{type:Object,default:void 0},class:{type:String,default:void 0}},setup(e,{slots:a,attrs:c}){let n=k(null),s=k(null);return _(i,{sceneRef:s}),D(()=>{let o=n.value;if(!o)return;$(o.ownerDocument??void 0);let t={};e.mode!==void 0&&(t.mode=e.mode),e.glyphPalette!==void 0&&(t.glyphPalette=e.glyphPalette),e.useColors!==void 0&&(t.useColors=e.useColors),e.cols!==void 0&&(t.cols=e.cols),e.rows!==void 0&&(t.rows=e.rows),e.cellAspect!==void 0&&(t.cellAspect=e.cellAspect),e.directionalLight!==void 0&&(t.directionalLight=e.directionalLight),e.ambientLight!==void 0&&(t.ambientLight=e.ambientLight),s.value=q(o,t)}),I(()=>{s.value?.destroy(),s.value=null}),U(()=>({mode:e.mode,glyphPalette:e.glyphPalette,useColors:e.useColors,cols:e.cols,rows:e.rows,cellAspect:e.cellAspect,directionalLight:e.directionalLight,ambientLight:e.ambientLight}),o=>{let t=s.value;if(!t)return;let r={};o.mode!==void 0&&(r.mode=o.mode),o.glyphPalette!==void 0&&(r.glyphPalette=o.glyphPalette),o.useColors!==void 0&&(r.useColors=o.useColors),o.cols!==void 0&&(r.cols=o.cols),o.rows!==void 0&&(r.rows=o.rows),o.cellAspect!==void 0&&(r.cellAspect=o.cellAspect),o.directionalLight!==void 0&&(r.directionalLight=o.directionalLight),o.ambientLight!==void 0&&(r.ambientLight=o.ambientLight),Object.keys(r).length>0&&t.setOptions(r)},{deep:!1}),()=>{let o=`glyphcss-host${e.class?` ${e.class}`:""}`;return Y("div",{ref:n,class:o,...Object.fromEntries(Object.entries(c).filter(([t])=>t!=="class"))},a.default?.())}}});import{defineComponent as J,h as W,inject as Q,onMounted as Z,onBeforeUnmount as ee,watch as j,shallowRef as te}from"vue";var P=J({name:"GlyphcssMesh",props:{id:{type:String,default:void 0},triangles:{type:Array,default:()=>[]},position:{type:Array,default:void 0},scale:{type:[Number,Array],default:void 0},rotation:{type:Array,default:void 0},class:{type:String,default:void 0}},setup(e,{slots:a}){let c=Q(i);if(!c)throw new Error("glyphcss: GlyphcssMesh must be used inside a GlyphcssScene.");let{sceneRef:n}=c,s=te(null);function o(){let l={};return e.position&&(l.position=e.position),e.scale!==void 0&&(l.scale=e.scale),e.rotation&&(l.rotation=e.rotation),l}function t(){let l=n.value;if(!l)return;let m=l.add(e.triangles??[],o());s.value=m}function r(){s.value?.dispose(),s.value=null}return Z(t),ee(r),j(()=>e.triangles,()=>{r(),t()}),j(()=>({position:e.position,scale:e.scale,rotation:e.rotation}),()=>{let l=s.value;l&&(l.setTransform(o()),n.value?.rerender())},{deep:!1}),()=>{let l=`glyphcss-mesh${e.class?` ${e.class}`:""}`;return W("div",{"data-glyphcss-mesh-id":e.id,class:l},a.default?.())}}});import{defineComponent as se,inject as oe,onMounted as ne,onBeforeUnmount as re,watch as le,shallowRef as ae}from"vue";var A=se({name:"GlyphcssHotspot",props:{id:{type:String,required:!0},at:{type:Array,required:!0},size:{type:Array,default:void 0}},emits:["click"],setup(e,{emit:a}){let c=oe(i);if(!c)throw new Error("glyphcss: GlyphcssHotspot must be used inside a GlyphcssScene.");let{sceneRef:n}=c,s=ae(null);function o(){let r=n.value;if(!r)return;let l=r.addHotspot({id:e.id,at:e.at,size:e.size},()=>a("click"));s.value=l}function t(){s.value?.remove(),s.value=null}return ne(o),re(t),le(()=>({id:e.id,at:e.at,size:e.size}),()=>{t(),o()},{deep:!1}),()=>null}});import{inject as ce}from"vue";function S(){let e=ce(i);if(!e)throw new Error("glyphcss: must be used inside a GlyphcssScene.");return e}import{defineComponent as ie,inject as pe,provide as ue,shallowRef as me,watch as ye,onMounted as he}from"vue";import{createGlyphcssPerspectiveCamera as fe}from"glyphcss";var f=Symbol("glyphcss-camera");var G=ie({name:"GlyphcssPerspectiveCamera",props:{rotX:{type:Number,default:void 0},rotY:{type:Number,default:void 0},distance:{type:Number,default:void 0},scale:{type:Number,default:void 0},stretch:{type:Number,default:void 0},center:{type:Array,default:void 0}},setup(e,{slots:a}){let c=pe(i);if(!c)throw new Error("glyphcss: GlyphcssPerspectiveCamera must be used inside a GlyphcssScene.");let{sceneRef:n}=c,s=me(null);function o(){n.value?.rerender()}return ue(f,{cameraRef:s,rerender:o}),he(()=>{let t={};e.rotX!==void 0&&(t.rotX=e.rotX),e.rotY!==void 0&&(t.rotY=e.rotY),e.distance!==void 0&&(t.distance=e.distance),e.scale!==void 0&&(t.scale=e.scale),e.stretch!==void 0&&(t.stretch=e.stretch),e.center!==void 0&&(t.center=e.center);let r=fe(t);s.value=r;let l=n.value;l&&(l.setOptions({camera:r}),l.rerender())}),ye(()=>({rotX:e.rotX,rotY:e.rotY,distance:e.distance,scale:e.scale,stretch:e.stretch}),t=>{let r=s.value;if(!r)return;let l=!1;t.rotX!==void 0&&r.rotX!==t.rotX&&(r.rotX=t.rotX,l=!0),t.rotY!==void 0&&r.rotY!==t.rotY&&(r.rotY=t.rotY,l=!0),t.distance!==void 0&&r.distance!==t.distance&&(r.distance=t.distance,l=!0),t.scale!==void 0&&r.scale!==t.scale&&(r.scale=t.scale,l=!0),t.stretch!==void 0&&r.stretch!==t.stretch&&(r.stretch=t.stretch,l=!0),l&&n.value?.rerender()}),()=>a.default?.()??null}});import{defineComponent as de,inject as Ge,provide as Ce,shallowRef as ge,watch as ve,onMounted as be}from"vue";import{createGlyphcssOrthographicCamera as xe}from"glyphcss";var w=de({name:"GlyphcssOrthographicCamera",props:{rotX:{type:Number,default:void 0},rotY:{type:Number,default:void 0},zoom:{type:Number,default:void 0},center:{type:Array,default:void 0}},setup(e,{slots:a}){let c=Ge(i);if(!c)throw new Error("glyphcss: GlyphcssOrthographicCamera must be used inside a GlyphcssScene.");let{sceneRef:n}=c,s=ge(null);function o(){n.value?.rerender()}return Ce(f,{cameraRef:s,rerender:o}),be(()=>{let t={};e.rotX!==void 0&&(t.rotX=e.rotX),e.rotY!==void 0&&(t.rotY=e.rotY),e.zoom!==void 0&&(t.zoom=e.zoom),e.center!==void 0&&(t.center=e.center);let r=xe(t);s.value=r;let l=n.value;l&&(l.setOptions({camera:r}),l.rerender())}),ve(()=>({rotX:e.rotX,rotY:e.rotY,zoom:e.zoom}),t=>{let r=s.value;if(!r)return;let l=!1;t.rotX!==void 0&&r.rotX!==t.rotX&&(r.rotX=t.rotX,l=!0),t.rotY!==void 0&&r.rotY!==t.rotY&&(r.rotY=t.rotY,l=!0),t.zoom!==void 0&&r.scale!==t.zoom&&(r.scale=t.zoom,l=!0),l&&n.value?.rerender()}),()=>a.default?.()??null}});import{inject as Pe}from"vue";function R(){let e=Pe(f);if(!e)throw new Error("glyphcss: useGlyphcssCamera must be used inside a GlyphcssCamera component.");return e}import{defineComponent as Ae,inject as Se,onMounted as we,onBeforeUnmount as Re,watch as Oe,shallowRef as Me}from"vue";import{createGlyphcssOrbitControls as Le}from"glyphcss";var O=Ae({name:"GlyphcssOrbitControls",props:{drag:{type:Boolean,default:!0},wheel:{type:Boolean,default:!0},invert:{type:[Boolean,Number],default:!1},animate:{type:[Boolean,Object],default:!1}},setup(e){let a=Se(i);if(!a)throw new Error("glyphcss: GlyphcssOrbitControls must be used inside a GlyphcssScene.");let{sceneRef:c}=a,n=Me(null);return we(()=>{let s=c.value;if(!s)return;let o={drag:e.drag,wheel:e.wheel,invert:e.invert,animate:e.animate===!1?!1:e.animate};n.value=Le(s,o)}),Re(()=>{n.value?.destroy(),n.value=null}),Oe(()=>({drag:e.drag,wheel:e.wheel,invert:e.invert,animate:e.animate}),s=>{n.value?.update({drag:s.drag,wheel:s.wheel,invert:s.invert,animate:s.animate===!1?!1:s.animate})}),()=>null}});import{defineComponent as Te,inject as He,onMounted as Ve,onBeforeUnmount as ke,watch as je,shallowRef as Be}from"vue";import{createGlyphcssMapControls as Ee}from"glyphcss";var M=Te({name:"GlyphcssMapControls",props:{drag:{type:Boolean,default:!0},wheel:{type:Boolean,default:!0},invert:{type:[Boolean,Number],default:!1},animate:{type:[Boolean,Object],default:!1}},setup(e){let a=He(i);if(!a)throw new Error("glyphcss: GlyphcssMapControls must be used inside a GlyphcssScene.");let{sceneRef:c}=a,n=Be(null);return Ve(()=>{let s=c.value;if(!s)return;let o={drag:e.drag,wheel:e.wheel,invert:e.invert,animate:e.animate===!1?!1:e.animate};n.value=Ee(s,o)}),ke(()=>{n.value?.destroy(),n.value=null}),je(()=>({drag:e.drag,wheel:e.wheel,invert:e.invert,animate:e.animate}),s=>{n.value?.update({drag:s.drag,wheel:s.wheel,invert:s.invert,animate:s.animate===!1?!1:s.animate})}),()=>null}});import{defineComponent as Fe,inject as Ne,onMounted as ze,onBeforeUnmount as Ke,watch as Xe,shallowRef as Ye}from"vue";import{createGlyphcssFirstPersonControls as _e}from"glyphcss";var L=Fe({name:"GlyphcssFirstPersonControls",props:{drag:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},moveSpeed:{type:Number,default:.05},lookSpeed:{type:Number,default:.004},invert:{type:[Boolean,Number],default:!1}},setup(e){let a=Ne(i);if(!a)throw new Error("glyphcss: GlyphcssFirstPersonControls must be used inside a GlyphcssScene.");let{sceneRef:c}=a,n=Ye(null);return ze(()=>{let s=c.value;if(!s)return;let o={drag:e.drag,keyboard:e.keyboard,moveSpeed:e.moveSpeed,lookSpeed:e.lookSpeed,invert:e.invert};n.value=_e(s,o)}),Ke(()=>{n.value?.destroy(),n.value=null}),Xe(()=>({drag:e.drag,keyboard:e.keyboard,moveSpeed:e.moveSpeed,lookSpeed:e.lookSpeed,invert:e.invert}),s=>{n.value?.update(s)}),()=>null}});import{defineComponent as De,inject as Ie,onMounted as Ue,onBeforeUnmount as qe,watch as $e,computed as Je,shallowRef as We}from"vue";function Qe(e){let a=e,c=a*.05,n=[];function s(o,t,r){let l=[o[0]-c,o[1]-c,o[2]],m=[t[0]-c,t[1]-c,t[2]],y=[t[0]+c,t[1]+c,t[2]],d=[o[0]+c,o[1]+c,o[2]];n.push({vertices:[l,m,y],color:r}),n.push({vertices:[l,y,d],color:r})}return s([0,0,0],[a,0,0],"#ff0000"),s([0,0,0],[0,a,0],"#00ff00"),s([0,0,0],[0,0,a],"#0000ff"),n}var T=De({name:"GlyphcssAxesHelper",props:{size:{type:Number,default:1}},setup(e){let a=Ie(i);if(!a)throw new Error("glyphcss: GlyphcssAxesHelper must be used inside a GlyphcssScene.");let{sceneRef:c}=a,n=We(null),s=Je(()=>Qe(e.size??1));function o(){let t=c.value;t&&(n.value=t.add(s.value))}return Ue(o),qe(()=>{n.value?.dispose(),n.value=null}),$e(s,()=>{n.value?.dispose(),n.value=null,o()}),()=>null}});import{defineComponent as Ze,inject as et,onMounted as tt,onBeforeUnmount as st,watch as ot,computed as nt,shallowRef as rt}from"vue";function lt(e,a,c){let[n,s,o]=e,t=c,r=[n,s,o+t],l=[n,s,o-t],m=[n+t,s,o],y=[n-t,s,o],d=[n,s+t,o],g=[n,s-t,o];return[{vertices:[r,m,d],color:a},{vertices:[r,d,y],color:a},{vertices:[r,y,g],color:a},{vertices:[r,g,m],color:a},{vertices:[l,d,m],color:a},{vertices:[l,y,d],color:a},{vertices:[l,g,y],color:a},{vertices:[l,m,g],color:a}]}var H=Ze({name:"GlyphcssDirectionalLightHelper",props:{position:{type:Array,default:()=>[1,1,1]},color:{type:String,default:"#ffff00"},size:{type:Number,default:.1}},setup(e){let a=et(i);if(!a)throw new Error("glyphcss: GlyphcssDirectionalLightHelper must be used inside a GlyphcssScene.");let{sceneRef:c}=a,n=rt(null),s=nt(()=>lt(e.position??[1,1,1],e.color??"#ffff00",e.size??.1));function o(){let t=c.value;t&&(n.value=t.add(s.value))}return tt(o),st(()=>{n.value?.dispose(),n.value=null}),ot(s,()=>{n.value?.dispose(),n.value=null,o()}),()=>null}});import{injectGlyphcssBaseStyles as B}from"glyphcss";import{ref as E,watch as at,onUnmounted as ct,computed as v}from"vue";import{createGlyphcssAnimationMixer as it}from"@glyphcss/core";function C(e){return e&&typeof e=="object"&&"value"in e?e.value:e}function V(e,a,c){let n=E(null),s=null,o=null,t=null,r=E(0);function l(){return c==null?n.value:C(c)??n.value}function m(){o!==null&&(cancelAnimationFrame(o),o=null),t=null}function y(){m(),s&&(s.stopAllAction(),s.uncacheRoot(),s=null,r.value++)}function d(){if(o!==null)return;function p(u){if(t===null){t=u,o=requestAnimationFrame(p);return}let h=(u-t)/1e3;t=u,s?.update(h),o=requestAnimationFrame(p)}o=requestAnimationFrame(p)}function g(){y();let p=C(e),u=C(a);if(!p||p.length===0||!u)return;let h=l();h&&(s=it(h,u),r.value++,d())}let F=at(()=>{let p=C(e),u=C(a),h=c!=null?C(c):n.value;return{c:p,ctrl:u,r:h}},()=>g(),{immediate:!0,deep:!1});ct(()=>{F(),y()});let b=v(()=>C(e)??[]),N=v(()=>b.value.map(p=>p.name)),z=v(()=>(r.value,s)),K=v(()=>{r.value;let p=b.value,u={};for(let h of p)Object.defineProperty(u,h.name,{enumerable:!0,get(){if(!s)return null;try{return s.clipAction(h.name)}catch{return null}}});return u});return{ref:n,mixer:z,clips:b,names:N,actions:K}}export{Mo as BASE_TILE,Ns as CAMERA_BACKFACE_CULL_EPS,Lo as DEFAULT_CAMERA_STATE,To as DEFAULT_PROJECTION,T as GlyphcssAxesHelper,G as GlyphcssCamera,f as GlyphcssCameraContextKey,H as GlyphcssDirectionalLightHelper,L as GlyphcssFirstPersonControls,A as GlyphcssHotspot,M as GlyphcssMapControls,P as GlyphcssMesh,O as GlyphcssOrbitControls,w as GlyphcssOrthographicCamera,G as GlyphcssPerspectiveCamera,x as GlyphcssScene,i as GlyphcssSceneContextKey,ko as LoopOnce,Bo as LoopPingPong,jo as LoopRepeat,zs as VOXEL_CAMERA_CULL_AXIS_EPS,Ks as VOXEL_CAMERA_CULL_NORMAL_LIMIT,Ao as arrowPolygons,Po as axesHelperPolygons,ao as bakeSolidTextureSampledPolygons,lo as bakeSolidTextureSamples,Ro as buildSceneContext,Us as cameraCullNormalGroups,qs as cameraCullNormalGroupsFromPolygons,$s as cameraCullNormalKey,Js as cameraCullVisibleSignature,Ws as cameraFacingDepth,go as clampChannel,Oo as computeSceneBbox,mo as computeShapeLighting,_s as coverPlanarPolygons,Vo as createGlyphcssAnimationMixer,io as createIsometricCamera,Is as cullInteriorPolygons,Co as formatColor,B as injectGlyphcssBaseStyles,xo as inverseRotateVec3,Qs as isAxisAlignedSurfaceNormal,Zs as isVoxelCameraCullableNormalGroups,co as loadMesh,Ys as mergePolygons,eo as normalFacesCamera,Ho as normalizeInvertMultiplier,Xs as normalizePolygons,wo as octahedronPolygons,Ds as optimizeMeshPolygons,yo as parseColor,ro as parseGltf,fo as parseHexColor,no as parseMtl,oo as parseObj,ho as parsePureColor,Go as parseRgbColor,po as parseVox,to as polygonCssSurfaceNormal,uo as polygonFaces,so as polygonFacesCamera,So as ringPolygons,bo as rotateVec3,vo as shadeColor,V as useGlyphcssAnimation,R as useGlyphcssCamera,S as useGlyphcssSceneContext};
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@glyphcss/vue",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Native Vue 3 components for the glyphcss ASCII polygon mesh rendering engine.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"glyphcss",
|
|
11
|
+
"ascii",
|
|
12
|
+
"polygon",
|
|
13
|
+
"mesh",
|
|
14
|
+
"3d",
|
|
15
|
+
"dom",
|
|
16
|
+
"vue",
|
|
17
|
+
"vue3",
|
|
18
|
+
"rendering"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/apresmoi/glyphcss.git",
|
|
24
|
+
"directory": "packages/vue"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/apresmoi/glyphcss/issues"
|
|
28
|
+
},
|
|
29
|
+
"homepage": "https://github.com/apresmoi/glyphcss#readme",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
33
|
+
"exports": {
|
|
34
|
+
".": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"import": "./dist/index.js",
|
|
37
|
+
"require": "./dist/index.cjs"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"publishConfig": {
|
|
41
|
+
"access": "public"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@glyphcss/core": "^0.0.1",
|
|
45
|
+
"glyphcss": "^0.0.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"vue": "^3.0.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
52
|
+
"happy-dom": "^20.8.9",
|
|
53
|
+
"tsup": "^8.0.1",
|
|
54
|
+
"typescript": "^5.3.3",
|
|
55
|
+
"vitest": "^3.2.4",
|
|
56
|
+
"vue": "^3.5.12"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsup",
|
|
60
|
+
"test": "vitest run",
|
|
61
|
+
"test:coverage": "vitest run --coverage"
|
|
62
|
+
}
|
|
63
|
+
}
|