@maucwerk/glimmer 0.0.0-stage → 1.0.14
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 +43 -0
- package/README.md +888 -2
- package/dist/components/__edge_decorator.d.ts +36 -0
- package/dist/components/conditional_lines/conditional_edges_geometry.d.ts +7 -0
- package/dist/components/conditional_lines/conditional_line_segments_geometry.d.ts +24 -0
- package/dist/components/conditional_lines/outside_edges_geometry.d.ts +7 -0
- package/dist/components/glimmer_viewer.d.ts +9 -0
- package/dist/environment/environment.d.ts +42 -0
- package/dist/environment/index.d.ts +2 -0
- package/dist/environment/sun.d.ts +21 -0
- package/dist/gizmos/index.d.ts +4 -0
- package/dist/gizmos/move_gizmo.d.ts +89 -0
- package/dist/gizmos/rotate_gizmo.d.ts +86 -0
- package/dist/gizmos/section_box_gizmo.d.ts +91 -0
- package/dist/gizmos/section_box_manager.d.ts +82 -0
- package/dist/glimmer.d.ts +26 -0
- package/dist/index.d.ts +13 -0
- package/dist/main.d.ts +1 -0
- package/dist/model/index.d.ts +3 -0
- package/dist/model/model.d.ts +88 -0
- package/dist/model/model_loader.d.ts +9 -0
- package/dist/model/model_manager.d.ts +55 -0
- package/dist/outline/index.d.ts +2 -0
- package/dist/outline/outline_material.d.ts +13 -0
- package/dist/outline/outline_mesh.d.ts +10 -0
- package/dist/section/index.d.ts +3 -0
- package/dist/section/plane_handle.d.ts +39 -0
- package/dist/section/section_box.d.ts +78 -0
- package/dist/section/section_cap.d.ts +15 -0
- package/dist/settings/index.d.ts +2 -0
- package/dist/settings/schema.d.ts +353 -0
- package/dist/settings/settings.d.ts +20 -0
- package/dist/shaders/colored_shadow_material.d.ts +7 -0
- package/dist/shaders/conditional_edges_shader.d.ts +16 -0
- package/dist/shaders/conditional_line_material.d.ts +16 -0
- package/dist/story/anchor_marker.d.ts +74 -0
- package/dist/story/anchor_marker_manager.d.ts +102 -0
- package/dist/story/annotation_2d_renderer.d.ts +24 -0
- package/dist/story/annotation_3d_renderer.d.ts +29 -0
- package/dist/story/annotation_renderer.d.ts +35 -0
- package/dist/story/index.d.ts +7 -0
- package/dist/story/schema.d.ts +1154 -0
- package/dist/story/slide_transition_manager.d.ts +30 -0
- package/dist/story/story_manager.d.ts +170 -0
- package/dist/story/trigger_manager.d.ts +43 -0
- package/dist/utils/constants.d.ts +6 -0
- package/dist/utils/cursor_3d.d.ts +48 -0
- package/dist/utils/error.d.ts +54 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/log.d.ts +8 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/viewer/index.d.ts +1 -0
- package/dist/viewer/orbit_controller.d.ts +62 -0
- package/dist/viewer/raycast_helper.d.ts +37 -0
- package/dist/viewer/viewer.d.ts +141 -0
- package/dist/vite/glimmer.mjs +11522 -0
- package/dist/vite/glimmer.umd.js +914 -0
- package/package.json +64 -4
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* Visual states for anchor markers
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AnchorMarkerState {
|
|
6
|
+
DEFAULT = 16746496,// Orange - default state
|
|
7
|
+
HOVER = 16776960,// Yellow - hover state
|
|
8
|
+
SELECTED = 65280
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AnchorMarker - Visual representation of a single 3D annotation anchor
|
|
12
|
+
*
|
|
13
|
+
* Displays a sphere at the anchor position with a line connecting to the label.
|
|
14
|
+
* Supports different visual states (default, hover, selected).
|
|
15
|
+
*/
|
|
16
|
+
export declare class AnchorMarker {
|
|
17
|
+
private group;
|
|
18
|
+
private sphere;
|
|
19
|
+
private line?;
|
|
20
|
+
private _state;
|
|
21
|
+
private _is_visible;
|
|
22
|
+
private readonly SPHERE_RADIUS;
|
|
23
|
+
private readonly LINE_WIDTH;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly position: THREE.Vector3;
|
|
26
|
+
/**
|
|
27
|
+
* Create a new anchor marker
|
|
28
|
+
* @param id - Unique identifier for this anchor
|
|
29
|
+
* @param position - World position of the anchor
|
|
30
|
+
* @param label_position - Optional position for the label (creates connecting line)
|
|
31
|
+
*/
|
|
32
|
+
constructor(id: string, position: THREE.Vector3, label_position?: THREE.Vector3);
|
|
33
|
+
/**
|
|
34
|
+
* Create or update the line connecting anchor to label
|
|
35
|
+
* @param label_position - Position of the label
|
|
36
|
+
*/
|
|
37
|
+
create_line(label_position: THREE.Vector3): void;
|
|
38
|
+
/**
|
|
39
|
+
* Remove the connecting line
|
|
40
|
+
*/
|
|
41
|
+
remove_line(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Set the visual state of the marker
|
|
44
|
+
* @param state - New state (DEFAULT, HOVER, SELECTED)
|
|
45
|
+
*/
|
|
46
|
+
set_state(state: AnchorMarkerState): void;
|
|
47
|
+
/**
|
|
48
|
+
* Get current visual state
|
|
49
|
+
*/
|
|
50
|
+
get state(): AnchorMarkerState;
|
|
51
|
+
/**
|
|
52
|
+
* Set marker visibility
|
|
53
|
+
* @param visible - Whether marker should be visible
|
|
54
|
+
*/
|
|
55
|
+
set_visible(visible: boolean): void;
|
|
56
|
+
/**
|
|
57
|
+
* Get marker visibility
|
|
58
|
+
*/
|
|
59
|
+
get visible(): boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Get the Three.js group containing all marker visuals
|
|
62
|
+
*/
|
|
63
|
+
get object(): THREE.Group;
|
|
64
|
+
/**
|
|
65
|
+
* Check if a raycast intersection hit this marker's sphere
|
|
66
|
+
* @param intersection - Raycast intersection result
|
|
67
|
+
* @returns true if intersection is this marker's sphere
|
|
68
|
+
*/
|
|
69
|
+
contains_intersection(intersection: THREE.Intersection): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Dispose of marker resources
|
|
72
|
+
*/
|
|
73
|
+
dispose(): void;
|
|
74
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { AnchorMarker } from './anchor_marker';
|
|
3
|
+
/**
|
|
4
|
+
* Anchor data structure for creating markers
|
|
5
|
+
*/
|
|
6
|
+
export interface AnchorData {
|
|
7
|
+
id: string;
|
|
8
|
+
position: THREE.Vector3;
|
|
9
|
+
label_position?: THREE.Vector3;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* AnchorMarkerManager - Manages all anchor markers in edit mode
|
|
13
|
+
*
|
|
14
|
+
* Handles creation, visibility, selection, hover states, and raycasting
|
|
15
|
+
* for all anchor markers in the scene.
|
|
16
|
+
*/
|
|
17
|
+
export declare class AnchorMarkerManager {
|
|
18
|
+
private markers;
|
|
19
|
+
private scene;
|
|
20
|
+
private raycaster;
|
|
21
|
+
private selected_marker?;
|
|
22
|
+
private hovered_marker?;
|
|
23
|
+
private _is_visible;
|
|
24
|
+
constructor(scene: THREE.Scene);
|
|
25
|
+
/**
|
|
26
|
+
* Create markers from anchor data array
|
|
27
|
+
* @param anchors - Array of anchor data
|
|
28
|
+
*/
|
|
29
|
+
create_markers(anchors: AnchorData[]): void;
|
|
30
|
+
/**
|
|
31
|
+
* Add a single marker
|
|
32
|
+
* @param anchor - Anchor data
|
|
33
|
+
*/
|
|
34
|
+
add_marker(anchor: AnchorData): void;
|
|
35
|
+
/**
|
|
36
|
+
* Remove a marker by id
|
|
37
|
+
* @param id - Marker id to remove
|
|
38
|
+
*/
|
|
39
|
+
remove_marker(id: string): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get a marker by id
|
|
42
|
+
* @param id - Marker id
|
|
43
|
+
* @returns Marker instance or undefined
|
|
44
|
+
*/
|
|
45
|
+
get_marker(id: string): AnchorMarker | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Get all markers
|
|
48
|
+
* @returns Array of all markers
|
|
49
|
+
*/
|
|
50
|
+
get_all_markers(): AnchorMarker[];
|
|
51
|
+
/**
|
|
52
|
+
* Clear all markers
|
|
53
|
+
*/
|
|
54
|
+
clear_markers(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Show all markers (make them visible)
|
|
57
|
+
*/
|
|
58
|
+
show_all_markers(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Hide all markers
|
|
61
|
+
*/
|
|
62
|
+
hide_all_markers(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Check if markers are visible
|
|
65
|
+
*/
|
|
66
|
+
get visible(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Raycast to find marker under mouse
|
|
69
|
+
* @param camera - Camera to raycast from
|
|
70
|
+
* @param mouse - Normalized mouse coordinates (-1 to 1)
|
|
71
|
+
* @returns Marker hit by raycast, or undefined
|
|
72
|
+
*/
|
|
73
|
+
raycast_markers(camera: THREE.Camera, mouse: THREE.Vector2): AnchorMarker | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Set the selected marker
|
|
76
|
+
* @param marker - Marker to select (or undefined to deselect all)
|
|
77
|
+
*/
|
|
78
|
+
select_marker(marker?: AnchorMarker): void;
|
|
79
|
+
/**
|
|
80
|
+
* Get the currently selected marker
|
|
81
|
+
*/
|
|
82
|
+
get_selected_marker(): AnchorMarker | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Set the hovered marker
|
|
85
|
+
* @param marker - Marker to hover (or undefined to clear hover)
|
|
86
|
+
*/
|
|
87
|
+
set_hovered_marker(marker?: AnchorMarker): void;
|
|
88
|
+
/**
|
|
89
|
+
* Get the currently hovered marker
|
|
90
|
+
*/
|
|
91
|
+
get_hovered_marker(): AnchorMarker | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Update marker line position (e.g., when label moves)
|
|
94
|
+
* @param id - Marker id
|
|
95
|
+
* @param label_position - New label position
|
|
96
|
+
*/
|
|
97
|
+
update_marker_line(id: string, label_position: THREE.Vector3): void;
|
|
98
|
+
/**
|
|
99
|
+
* Dispose of all resources
|
|
100
|
+
*/
|
|
101
|
+
dispose(): void;
|
|
102
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AnnotationType } from './schema';
|
|
2
|
+
import type { AnnotationRenderer, Annotation2DRendererConfig } from './annotation_renderer';
|
|
3
|
+
/**
|
|
4
|
+
* Renders 2D HTML overlay annotations.
|
|
5
|
+
* Creates positioned div elements with sanitized HTML content.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Annotation2DRenderer implements AnnotationRenderer {
|
|
8
|
+
private container;
|
|
9
|
+
private elements;
|
|
10
|
+
constructor(config: Annotation2DRendererConfig);
|
|
11
|
+
/**
|
|
12
|
+
* Render a 2D annotation as an HTML overlay
|
|
13
|
+
* @param annotation - The annotation to render
|
|
14
|
+
*/
|
|
15
|
+
render(annotation: AnnotationType): void;
|
|
16
|
+
/**
|
|
17
|
+
* Clear all rendered 2D annotations
|
|
18
|
+
*/
|
|
19
|
+
clear(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Dispose of resources (same as clear for 2D)
|
|
22
|
+
*/
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { AnnotationType } from './schema';
|
|
3
|
+
import type { AnnotationRenderer, Annotation3DRendererConfig } from './annotation_renderer';
|
|
4
|
+
/**
|
|
5
|
+
* Renders 3D sprite-based annotations in the scene.
|
|
6
|
+
* Creates canvas-based sprite labels positioned in 3D space.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Annotation3DRenderer implements AnnotationRenderer {
|
|
9
|
+
private group;
|
|
10
|
+
private sprites;
|
|
11
|
+
constructor(config: Annotation3DRendererConfig);
|
|
12
|
+
/**
|
|
13
|
+
* Render a 3D annotation as a sprite label
|
|
14
|
+
* @param annotation - The annotation to render
|
|
15
|
+
*/
|
|
16
|
+
render(annotation: AnnotationType): void;
|
|
17
|
+
/**
|
|
18
|
+
* Clear all rendered 3D annotations
|
|
19
|
+
*/
|
|
20
|
+
clear(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Dispose of resources and remove group from scene
|
|
23
|
+
*/
|
|
24
|
+
dispose(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Get the 3D group containing all sprites
|
|
27
|
+
*/
|
|
28
|
+
get_group(): THREE.Group;
|
|
29
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import type { AnnotationType } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Base interface for annotation renderers.
|
|
5
|
+
* Implements the Strategy pattern for rendering different annotation types.
|
|
6
|
+
*/
|
|
7
|
+
export interface AnnotationRenderer {
|
|
8
|
+
/**
|
|
9
|
+
* Render an annotation
|
|
10
|
+
* @param annotation - The annotation to render
|
|
11
|
+
* @returns void
|
|
12
|
+
*/
|
|
13
|
+
render(annotation: AnnotationType): void;
|
|
14
|
+
/**
|
|
15
|
+
* Clear all rendered annotations
|
|
16
|
+
*/
|
|
17
|
+
clear(): void;
|
|
18
|
+
/**
|
|
19
|
+
* Dispose of resources
|
|
20
|
+
*/
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for 2D annotation renderer
|
|
25
|
+
*/
|
|
26
|
+
export interface Annotation2DRendererConfig {
|
|
27
|
+
container: HTMLElement;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Configuration for 3D annotation renderer
|
|
31
|
+
*/
|
|
32
|
+
export interface Annotation3DRendererConfig {
|
|
33
|
+
scene: THREE.Scene;
|
|
34
|
+
group_name?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { StoryManager } from './story_manager';
|
|
2
|
+
export type { StoryType, StorySlideType, AnnotationType, TransitionType } from './schema';
|
|
3
|
+
export { StorySchema, StorySlideSchema, AnnotationSchema, TransitionSchema } from './schema';
|
|
4
|
+
export { AnchorMarker, AnchorMarkerState } from './anchor_marker';
|
|
5
|
+
export { AnchorMarkerManager } from './anchor_marker_manager';
|
|
6
|
+
export type { AnchorData } from './anchor_marker_manager';
|
|
7
|
+
export { SlideTransitionManager } from './slide_transition_manager';
|