vim-web 0.6.0-dev.1 → 0.6.0-dev.3
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/dist/types/core-viewers/webgl/loader/vimCollection.d.ts +3 -2
- package/dist/types/core-viewers/webgl/viewer/rendering/gpuPicker.d.ts +28 -10
- package/dist/vim-web.iife.js +290 -239
- package/dist/vim-web.iife.js.map +1 -1
- package/dist/vim-web.js +290 -239
- package/dist/vim-web.js.map +1 -1
- package/package.json +1 -1
|
@@ -6,9 +6,10 @@ import { IVimCollection } from '../../shared/vimCollection';
|
|
|
6
6
|
import { Vim } from './vim';
|
|
7
7
|
/**
|
|
8
8
|
* Maximum number of vims that can be loaded simultaneously.
|
|
9
|
-
* Limited by the 8-bit vimIndex in GPU picking
|
|
9
|
+
* Limited by the 8-bit vimIndex in GPU picking.
|
|
10
|
+
* Index 255 is reserved for marker gizmos, so vims use 0-254.
|
|
10
11
|
*/
|
|
11
|
-
export declare const MAX_VIMS =
|
|
12
|
+
export declare const MAX_VIMS = 255;
|
|
12
13
|
/**
|
|
13
14
|
* Manages a collection of Vim objects with stable IDs for GPU picking.
|
|
14
15
|
*
|
|
@@ -10,8 +10,13 @@ import { Vim } from '../../loader/vim';
|
|
|
10
10
|
import { VimCollection } from '../../loader/vimCollection';
|
|
11
11
|
import type { IRaycaster, IRaycastResult } from '../../../shared';
|
|
12
12
|
import { Marker } from '../gizmos/markers/gizmoMarker';
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
import type { GizmoMarkers } from '../gizmos/markers/gizmoMarkers';
|
|
14
|
+
import type { Selectable } from '../selection';
|
|
15
|
+
/**
|
|
16
|
+
* Reserved vimIndex for marker gizmos in GPU picking.
|
|
17
|
+
* Markers use this index to distinguish them from vim elements.
|
|
18
|
+
*/
|
|
19
|
+
export declare const MARKER_VIM_INDEX = 255;
|
|
15
20
|
/**
|
|
16
21
|
* Packs vimIndex (8 bits) and elementIndex (24 bits) into a single uint32.
|
|
17
22
|
* Used for GPU picking attribute.
|
|
@@ -28,10 +33,10 @@ export declare function unpackPickingId(packedId: number): {
|
|
|
28
33
|
* Result of a GPU pick operation containing element index, world position, and surface normal.
|
|
29
34
|
* Implements IRaycastResult for compatibility with the raycaster interface.
|
|
30
35
|
*/
|
|
31
|
-
export declare class GpuPickResult implements IRaycastResult<
|
|
32
|
-
/** The element index in the vim */
|
|
36
|
+
export declare class GpuPickResult implements IRaycastResult<Selectable> {
|
|
37
|
+
/** The element index in the vim (or marker index if vimIndex === MARKER_VIM_INDEX) */
|
|
33
38
|
readonly elementIndex: number;
|
|
34
|
-
/** The vim index identifying which vim the element belongs to */
|
|
39
|
+
/** The vim index identifying which vim the element belongs to (255 = marker) */
|
|
35
40
|
readonly vimIndex: number;
|
|
36
41
|
/** The world position of the hit */
|
|
37
42
|
readonly worldPosition: THREE.Vector3;
|
|
@@ -39,17 +44,24 @@ export declare class GpuPickResult implements IRaycastResult<GpuRaycastableObjec
|
|
|
39
44
|
readonly worldNormal: THREE.Vector3;
|
|
40
45
|
/** Reference to the vim containing the element */
|
|
41
46
|
private _vim;
|
|
42
|
-
|
|
47
|
+
/** Reference to the marker if this is a marker hit */
|
|
48
|
+
private _marker;
|
|
49
|
+
constructor(elementIndex: number, vimIndex: number, worldPosition: THREE.Vector3, worldNormal: THREE.Vector3, vim: Vim | undefined, marker?: Marker);
|
|
43
50
|
/**
|
|
44
51
|
* The object property for IRaycastResult interface.
|
|
45
|
-
* Returns the Element3D for the picked
|
|
52
|
+
* Returns the Element3D or Marker for the picked object.
|
|
46
53
|
*/
|
|
47
|
-
get object():
|
|
54
|
+
get object(): Selectable | undefined;
|
|
48
55
|
/**
|
|
49
56
|
* Gets the Element3D object for the picked element.
|
|
50
|
-
* @returns The Element3D object, or undefined if not found
|
|
57
|
+
* @returns The Element3D object, or undefined if not found or if this is a marker hit
|
|
51
58
|
*/
|
|
52
59
|
getElement(): Element3D | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the Marker object if this is a marker hit.
|
|
62
|
+
* @returns The Marker object, or undefined if this is an element hit
|
|
63
|
+
*/
|
|
64
|
+
getMarker(): Marker | undefined;
|
|
53
65
|
}
|
|
54
66
|
/**
|
|
55
67
|
* Unified GPU picker that outputs element index, depth, vim index, and surface normal in a single render pass.
|
|
@@ -63,11 +75,12 @@ export declare class GpuPickResult implements IRaycastResult<GpuRaycastableObjec
|
|
|
63
75
|
*
|
|
64
76
|
* Normal.z is reconstructed as: sqrt(1 - x² - y²), always positive since normal faces camera.
|
|
65
77
|
*/
|
|
66
|
-
export declare class GpuPicker implements IRaycaster<
|
|
78
|
+
export declare class GpuPicker implements IRaycaster<Selectable> {
|
|
67
79
|
private _renderer;
|
|
68
80
|
private _camera;
|
|
69
81
|
private _scene;
|
|
70
82
|
private _vims;
|
|
83
|
+
private _markers;
|
|
71
84
|
private _section;
|
|
72
85
|
private _renderTarget;
|
|
73
86
|
private _pickingMaterial;
|
|
@@ -76,6 +89,11 @@ export declare class GpuPicker implements IRaycaster<GpuRaycastableObject> {
|
|
|
76
89
|
private _debugSphere;
|
|
77
90
|
private _debugLine;
|
|
78
91
|
constructor(renderer: THREE.WebGLRenderer, camera: Camera, scene: RenderScene, vims: VimCollection, section: RenderingSection, width: number, height: number);
|
|
92
|
+
/**
|
|
93
|
+
* Sets the GizmoMarkers reference for marker picking.
|
|
94
|
+
* Must be called after gizmos are initialized.
|
|
95
|
+
*/
|
|
96
|
+
setMarkers(markers: GizmoMarkers): void;
|
|
79
97
|
/**
|
|
80
98
|
* Updates the render target size to match viewport.
|
|
81
99
|
*/
|