@kingsy/viewer 2.25.7
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/IViewer.d.ts +157 -0
- package/dist/helpers/flatten.d.ts +11 -0
- package/dist/helpers/typeHelper.d.ts +2 -0
- package/dist/index.d.ts +89 -0
- package/dist/index.js +42 -0
- package/dist/modules/Assets.d.ts +15 -0
- package/dist/modules/EventEmitter.d.ts +7 -0
- package/dist/modules/Helpers.d.ts +3 -0
- package/dist/modules/Intersections.d.ts +20 -0
- package/dist/modules/KingSyRenderer.d.ts +168 -0
- package/dist/modules/LegacyViewer.d.ts +77 -0
- package/dist/modules/Shadowcatcher.d.ts +25 -0
- package/dist/modules/ShadowcatcherConfig.d.ts +14 -0
- package/dist/modules/UrlHelper.d.ts +1 -0
- package/dist/modules/Utils.d.ts +10 -0
- package/dist/modules/Viewer.d.ts +74 -0
- package/dist/modules/WebXrViewer.d.ts +10 -0
- package/dist/modules/World.d.ts +31 -0
- package/dist/modules/batching/Batch.d.ts +62 -0
- package/dist/modules/batching/BatchObject.d.ts +53 -0
- package/dist/modules/batching/Batcher.d.ts +60 -0
- package/dist/modules/batching/DrawRanges.d.ts +6 -0
- package/dist/modules/batching/InstancedBatchObject.d.ts +8 -0
- package/dist/modules/batching/InstancedMeshBatch.d.ts +60 -0
- package/dist/modules/batching/LineBatch.d.ts +52 -0
- package/dist/modules/batching/MeshBatch.d.ts +35 -0
- package/dist/modules/batching/PointBatch.d.ts +29 -0
- package/dist/modules/batching/PrimitiveBatch.d.ts +57 -0
- package/dist/modules/batching/TextBatch.d.ts +41 -0
- package/dist/modules/converter/Geometry.d.ts +38 -0
- package/dist/modules/converter/MeshTriangulationHelper.d.ts +50 -0
- package/dist/modules/converter/Units.d.ts +12 -0
- package/dist/modules/extensions/CameraController.d.ts +95 -0
- package/dist/modules/extensions/Controls.d.ts +91 -0
- package/dist/modules/extensions/DiffExtension.d.ts +50 -0
- package/dist/modules/extensions/ExplodeExtension.d.ts +17 -0
- package/dist/modules/extensions/Extension.d.ts +15 -0
- package/dist/modules/extensions/FilteringExtension.d.ts +55 -0
- package/dist/modules/extensions/HybridCameraController.d.ts +14 -0
- package/dist/modules/extensions/SelectionExtension.d.ts +53 -0
- package/dist/modules/extensions/TransformControls.d.ts +157 -0
- package/dist/modules/extensions/ViewModes.d.ts +32 -0
- package/dist/modules/extensions/controls/FlyControls.d.ts +82 -0
- package/dist/modules/extensions/controls/KingSyControls.d.ts +25 -0
- package/dist/modules/extensions/controls/SmoothOrbitControls.d.ts +222 -0
- package/dist/modules/extensions/measurements/AreaMeasurement.d.ts +64 -0
- package/dist/modules/extensions/measurements/Measurement.d.ts +34 -0
- package/dist/modules/extensions/measurements/MeasurementPointGizmo.d.ts +42 -0
- package/dist/modules/extensions/measurements/MeasurementsExtension.d.ts +71 -0
- package/dist/modules/extensions/measurements/PerpendicularMeasurement.d.ts +19 -0
- package/dist/modules/extensions/measurements/PointMeasurement.d.ts +25 -0
- package/dist/modules/extensions/measurements/PointToPointMeasurement.d.ts +15 -0
- package/dist/modules/extensions/sections/SectionOutlines.d.ts +45 -0
- package/dist/modules/extensions/sections/SectionTool.d.ts +219 -0
- package/dist/modules/filtering/PropertyManager.d.ts +55 -0
- package/dist/modules/input/Input.d.ts +47 -0
- package/dist/modules/loaders/GeometryConverter.d.ts +32 -0
- package/dist/modules/loaders/KingSy/KingSyConverter.d.ts +118 -0
- package/dist/modules/loaders/KingSy/KingSyGeometryConverter.d.ts +127 -0
- package/dist/modules/loaders/KingSy/KingSyLoader.d.ts +18 -0
- package/dist/modules/loaders/KingSy/KingSyOfflineLoader.d.ts +8 -0
- package/dist/modules/loaders/Loader.d.ts +35 -0
- package/dist/modules/loaders/OBJ/ObjConverter.d.ts +18 -0
- package/dist/modules/loaders/OBJ/ObjGeometryConverter.d.ts +14 -0
- package/dist/modules/loaders/OBJ/ObjLoader.d.ts +16 -0
- package/dist/modules/materials/KingSyBasicMaterial.d.ts +26 -0
- package/dist/modules/materials/KingSyDepthMaterial.d.ts +22 -0
- package/dist/modules/materials/KingSyDepthNormalIdMaterial.d.ts +11 -0
- package/dist/modules/materials/KingSyDepthNormalMaterial.d.ts +6 -0
- package/dist/modules/materials/KingSyDisplaceMaterial.d.ts +11 -0
- package/dist/modules/materials/KingSyGhostMaterial.d.ts +8 -0
- package/dist/modules/materials/KingSyLineMaterial.d.ts +20 -0
- package/dist/modules/materials/KingSyMatcapMaterial.d.ts +19 -0
- package/dist/modules/materials/KingSyMaterial.d.ts +65 -0
- package/dist/modules/materials/KingSyNormalMaterial.d.ts +18 -0
- package/dist/modules/materials/KingSyPointColouredMaterial.d.ts +12 -0
- package/dist/modules/materials/KingSyPointMaterial.d.ts +18 -0
- package/dist/modules/materials/KingSyShadowcatcherMaterial.d.ts +10 -0
- package/dist/modules/materials/KingSyStandardColoredMaterial.d.ts +11 -0
- package/dist/modules/materials/KingSyStandardMaterial.d.ts +22 -0
- package/dist/modules/materials/KingSyTextMaterial.d.ts +26 -0
- package/dist/modules/materials/KingSyViewportMaterial.d.ts +13 -0
- package/dist/modules/materials/MaterialOptions.d.ts +6 -0
- package/dist/modules/materials/Materials.d.ts +111 -0
- package/dist/modules/materials/shaders/kingsy-apply-ao-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-apply-ao-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-basic-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-basic-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-copy-output-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-copy-output-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-normal-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-normal-id-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-normal-id-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-normal-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-depth-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-displace-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-displace.vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-edges-generator-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-edges-generator-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-ghost-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-ghost-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-line-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-line-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-normal-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-normal-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-point-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-point-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-sao-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-sao-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-shadowcatche-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-shadowcatcher-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-standard-colored-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-standard-colored-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-standard-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-standard-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-static-ao-accumulate-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-static-ao-accumulate-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-static-ao-generate-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-static-ao-generate-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-temporal-supersampling-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-temporal-supersampling-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-text-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-text-vert.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-viewport-frag.d.ts +1 -0
- package/dist/modules/materials/shaders/kingsy-viewport-vert.d.ts +1 -0
- package/dist/modules/objects/AccelerationStructure.d.ts +72 -0
- package/dist/modules/objects/ExtendedInstancedMesh.d.ts +6 -0
- package/dist/modules/objects/JitterQuad.d.ts +10 -0
- package/dist/modules/objects/KingSyCamera.d.ts +31 -0
- package/dist/modules/objects/KingSyInstancedMesh.d.ts +44 -0
- package/dist/modules/objects/KingSyMesh.d.ts +43 -0
- package/dist/modules/objects/KingSyRaycaster.d.ts +42 -0
- package/dist/modules/objects/KingSyText.d.ts +39 -0
- package/dist/modules/objects/KingSyWebGLRenderer.d.ts +24 -0
- package/dist/modules/objects/RotatablePMREMGenerator.d.ts +5 -0
- package/dist/modules/objects/TopLevelAccelerationStructure.d.ts +41 -0
- package/dist/modules/pipeline/Passes/BlendPass.d.ts +17 -0
- package/dist/modules/pipeline/Passes/DepthNormalIdPass.d.ts +12 -0
- package/dist/modules/pipeline/Passes/DepthNormalPass.d.ts +25 -0
- package/dist/modules/pipeline/Passes/DepthPass.d.ts +23 -0
- package/dist/modules/pipeline/Passes/EdgesPass.d.ts +25 -0
- package/dist/modules/pipeline/Passes/GPass.d.ts +88 -0
- package/dist/modules/pipeline/Passes/GeometryPass.d.ts +7 -0
- package/dist/modules/pipeline/Passes/NormalsPass.d.ts +8 -0
- package/dist/modules/pipeline/Passes/OutputPass.d.ts +23 -0
- package/dist/modules/pipeline/Passes/ProgressiveAOPass.d.ts +30 -0
- package/dist/modules/pipeline/Passes/ShadedPass.d.ts +26 -0
- package/dist/modules/pipeline/Passes/ShadowcatcherPass.d.ts +43 -0
- package/dist/modules/pipeline/Passes/StencilMaskPass.d.ts +9 -0
- package/dist/modules/pipeline/Passes/StencilPass.d.ts +9 -0
- package/dist/modules/pipeline/Passes/TAAPass.d.ts +15 -0
- package/dist/modules/pipeline/Passes/ViewportPass.d.ts +22 -0
- package/dist/modules/pipeline/Pipelines/ArcticViewPipeline.d.ts +7 -0
- package/dist/modules/pipeline/Pipelines/DefaultPipeline.d.ts +6 -0
- package/dist/modules/pipeline/Pipelines/EdgesPipeline.d.ts +28 -0
- package/dist/modules/pipeline/Pipelines/PenViewPipeline.d.ts +6 -0
- package/dist/modules/pipeline/Pipelines/Pipeline.d.ts +43 -0
- package/dist/modules/pipeline/Pipelines/ProgressivePipeline.d.ts +24 -0
- package/dist/modules/pipeline/Pipelines/ShadedViewPipeline.d.ts +7 -0
- package/dist/modules/pipeline/Pipelines/SolidViewPipeline.d.ts +6 -0
- package/dist/modules/pipeline/Pipelines/TAAPipeline.d.ts +7 -0
- package/dist/modules/queries/IntersectionQuerySolver.d.ts +11 -0
- package/dist/modules/queries/PointQuerySolver.d.ts +9 -0
- package/dist/modules/queries/Queries.d.ts +9 -0
- package/dist/modules/queries/Query.d.ts +51 -0
- package/dist/modules/three/stats.d.ts +4 -0
- package/dist/modules/tree/NodeMap.d.ts +20 -0
- package/dist/modules/tree/NodeRenderView.d.ts +51 -0
- package/dist/modules/tree/RenderTree.d.ts +36 -0
- package/dist/modules/tree/WorldTree.d.ts +52 -0
- package/dist/modules/utils/AngleDamper.d.ts +18 -0
- package/dist/modules/utils/Damper.d.ts +17 -0
- package/dist/modules/utils/Logger.d.ts +2 -0
- package/dist/type-augmentations/three-extensions.d.ts +1 -0
- package/package.json +99 -0
- package/readme.md +30 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Extension } from './Extension.js';
|
|
2
|
+
import { WorldTree } from '../tree/WorldTree.js';
|
|
3
|
+
import { type IViewer } from '../../IViewer.js';
|
|
4
|
+
import type { PropertyInfo } from '../filtering/PropertyManager.js';
|
|
5
|
+
/** TO DO: Should remove selectedObjects entirely*/
|
|
6
|
+
export type FilteringState = {
|
|
7
|
+
selectedObjects?: string[];
|
|
8
|
+
hiddenObjects?: string[];
|
|
9
|
+
isolatedObjects?: string[];
|
|
10
|
+
colorGroups?: {
|
|
11
|
+
value: string;
|
|
12
|
+
color: string;
|
|
13
|
+
ids: string[];
|
|
14
|
+
}[];
|
|
15
|
+
userColorGroups?: {
|
|
16
|
+
ids: string[];
|
|
17
|
+
color: string;
|
|
18
|
+
}[];
|
|
19
|
+
activePropFilterKey?: string;
|
|
20
|
+
passMin?: number | null;
|
|
21
|
+
passMax?: number | null;
|
|
22
|
+
};
|
|
23
|
+
export declare class FilteringExtension extends Extension {
|
|
24
|
+
WTI: WorldTree;
|
|
25
|
+
private Renderer;
|
|
26
|
+
private StateKey;
|
|
27
|
+
private VisibilityState;
|
|
28
|
+
private ColorStringFilterState;
|
|
29
|
+
private ColorNumericFilterState;
|
|
30
|
+
private UserspaceColorState;
|
|
31
|
+
private CurrentFilteringState;
|
|
32
|
+
get filteringState(): FilteringState;
|
|
33
|
+
get enabled(): boolean;
|
|
34
|
+
set enabled(value: boolean);
|
|
35
|
+
constructor(viewer: IViewer);
|
|
36
|
+
hideObjects(objectIds: string[], stateKey?: string | undefined, includeDescendants?: boolean, ghost?: boolean): FilteringState;
|
|
37
|
+
showObjects(objectIds: string[], stateKey?: string | undefined, includeDescendants?: boolean): FilteringState;
|
|
38
|
+
isolateObjects(objectIds: string[], stateKey?: string | undefined, includeDescendants?: boolean, ghost?: boolean): FilteringState;
|
|
39
|
+
unIsolateObjects(objectIds: string[], stateKey?: string | undefined, includeDescendants?: boolean, ghost?: boolean): FilteringState;
|
|
40
|
+
private setVisibilityState;
|
|
41
|
+
private visibilityWalk;
|
|
42
|
+
setColorFilter(prop: PropertyInfo, ghost?: boolean): FilteringState;
|
|
43
|
+
private setNumericColorFilter;
|
|
44
|
+
private setStringColorFilter;
|
|
45
|
+
removeColorFilter(): FilteringState;
|
|
46
|
+
setUserObjectColors(groups: {
|
|
47
|
+
objectIds: string[];
|
|
48
|
+
color: string;
|
|
49
|
+
}[]): FilteringState;
|
|
50
|
+
removeUserObjectColors(): FilteringState;
|
|
51
|
+
resetFilters(): FilteringState | null;
|
|
52
|
+
private setFilters;
|
|
53
|
+
private idCache;
|
|
54
|
+
private getDescendantIds;
|
|
55
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IViewer } from '../../IViewer.js';
|
|
2
|
+
import { CameraController } from './CameraController.js';
|
|
3
|
+
type MoveType = 'forward' | 'back' | 'left' | 'right' | 'up' | 'down';
|
|
4
|
+
export declare class HybridCameraController extends CameraController {
|
|
5
|
+
protected keyMap: Record<MoveType, boolean>;
|
|
6
|
+
protected contextMenuTriggered: boolean;
|
|
7
|
+
constructor(viewer: IViewer);
|
|
8
|
+
onEarlyUpdate(_delta?: number): void;
|
|
9
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
10
|
+
protected onKeyUp(event: KeyboardEvent): void;
|
|
11
|
+
protected onContextMenu(): void;
|
|
12
|
+
protected cancelMove(): void;
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Extension } from './Extension.js';
|
|
2
|
+
import { NodeRenderView } from '../tree/NodeRenderView.js';
|
|
3
|
+
import { Material, Vector2 } from 'three';
|
|
4
|
+
import { type IViewer, type SelectionEvent } from '../../IViewer.js';
|
|
5
|
+
import { type DisplayStyle, type RenderMaterial } from '../materials/Materials.js';
|
|
6
|
+
import { type MaterialOptions } from '../materials/MaterialOptions.js';
|
|
7
|
+
import { type TreeNode } from '../tree/WorldTree.js';
|
|
8
|
+
import { CameraController } from './CameraController.js';
|
|
9
|
+
export interface SelectionExtensionOptions {
|
|
10
|
+
selectionMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
11
|
+
hoverMaterialData?: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare const DefaultSelectionExtensionOptions: SelectionExtensionOptions;
|
|
14
|
+
export declare class SelectionExtension extends Extension {
|
|
15
|
+
protected cameraProvider: CameraController;
|
|
16
|
+
get inject(): (typeof CameraController)[];
|
|
17
|
+
protected selectedNodes: Array<TreeNode>;
|
|
18
|
+
protected selectionRvs: {
|
|
19
|
+
[id: string]: NodeRenderView;
|
|
20
|
+
};
|
|
21
|
+
protected selectionMaterials: {
|
|
22
|
+
[id: string]: Material;
|
|
23
|
+
};
|
|
24
|
+
protected hoverRv: NodeRenderView | null;
|
|
25
|
+
protected hoverMaterial: Material | null;
|
|
26
|
+
protected selectionMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
27
|
+
protected hoverMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
28
|
+
protected transparentSelectionMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
29
|
+
protected transparentHoverMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
30
|
+
protected hiddenSelectionMaterialData: RenderMaterial & DisplayStyle & MaterialOptions;
|
|
31
|
+
protected _enabled: boolean;
|
|
32
|
+
protected _options: SelectionExtensionOptions;
|
|
33
|
+
get enabled(): boolean;
|
|
34
|
+
set enabled(value: boolean);
|
|
35
|
+
get options(): SelectionExtensionOptions;
|
|
36
|
+
set options(value: SelectionExtensionOptions);
|
|
37
|
+
constructor(viewer: IViewer, cameraProvider: CameraController);
|
|
38
|
+
getSelectedObjects(): Array<Record<string, unknown>>;
|
|
39
|
+
getSelectedNodes(): Array<TreeNode>;
|
|
40
|
+
selectObjects(ids: Array<string>, multiSelect?: boolean): void;
|
|
41
|
+
/**TO DO: This is redundant */
|
|
42
|
+
unselectObjects(ids: Array<string>): void;
|
|
43
|
+
clearSelection(nodes?: Array<TreeNode>): void;
|
|
44
|
+
protected onObjectClicked(selection: SelectionEvent | null): void;
|
|
45
|
+
protected onObjectDoubleClick(selectionInfo: SelectionEvent | null): void;
|
|
46
|
+
protected onPointerMove(e: Vector2 & {
|
|
47
|
+
event: Event;
|
|
48
|
+
}): void;
|
|
49
|
+
protected applySelection(): void;
|
|
50
|
+
protected removeSelection(rvs?: Array<NodeRenderView>): void;
|
|
51
|
+
protected applyHover(renderView: NodeRenderView | null): void;
|
|
52
|
+
protected removeHover(): void;
|
|
53
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export function intersectObjectWithRay(object: any, raycaster: any, includeInvisible: any): any;
|
|
2
|
+
/**
|
|
3
|
+
* This class can be used to transform objects in 3D space by adapting a similar interaction model
|
|
4
|
+
* of DCC tools like Blender. Unlike other controls, it is not intended to transform the scene's camera.
|
|
5
|
+
*
|
|
6
|
+
* `TransformControls` expects that its attached 3D object is part of the scene graph.
|
|
7
|
+
*
|
|
8
|
+
* @augments Controls
|
|
9
|
+
*/
|
|
10
|
+
export class TransformControls extends Controls {
|
|
11
|
+
_root: TransformControlsRoot;
|
|
12
|
+
_gizmo: TransformControlsGizmo;
|
|
13
|
+
_plane: TransformControlsPlane;
|
|
14
|
+
_doNotPick: boolean;
|
|
15
|
+
_offset: Vector3;
|
|
16
|
+
_startNorm: Vector3;
|
|
17
|
+
_endNorm: Vector3;
|
|
18
|
+
_cameraScale: Vector3;
|
|
19
|
+
_parentPosition: Vector3;
|
|
20
|
+
_parentQuaternion: Quaternion;
|
|
21
|
+
_parentQuaternionInv: Quaternion;
|
|
22
|
+
_parentScale: Vector3;
|
|
23
|
+
_worldScaleStart: Vector3;
|
|
24
|
+
_worldQuaternionInv: Quaternion;
|
|
25
|
+
_worldScale: Vector3;
|
|
26
|
+
_positionStart: Vector3;
|
|
27
|
+
_quaternionStart: Quaternion;
|
|
28
|
+
_scaleStart: Vector3;
|
|
29
|
+
_getPointer: typeof getPointer;
|
|
30
|
+
_onPointerDown: typeof onPointerDown;
|
|
31
|
+
_onPointerHover: typeof onPointerHover;
|
|
32
|
+
_onPointerMove: typeof onPointerMove;
|
|
33
|
+
_onPointerUp: typeof onPointerUp;
|
|
34
|
+
/**
|
|
35
|
+
* Returns the visual representation of the controls. Add the helper to your scene to
|
|
36
|
+
* visually transform the attached 3D object.
|
|
37
|
+
*
|
|
38
|
+
* @return {TransformControlsRoot} The helper.
|
|
39
|
+
*/
|
|
40
|
+
getHelper(): TransformControlsRoot;
|
|
41
|
+
pointerHover(pointer: any): void;
|
|
42
|
+
axis: any;
|
|
43
|
+
pointerDown(pointer: any): void;
|
|
44
|
+
dragging: boolean | undefined;
|
|
45
|
+
pointerMove(pointer: any): void;
|
|
46
|
+
rotationAngle: any;
|
|
47
|
+
pointerUp(pointer: any): void;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the 3D object that should be transformed and ensures the controls UI is visible.
|
|
50
|
+
*
|
|
51
|
+
* @param {Object3D} object - The 3D object that should be transformed.
|
|
52
|
+
* @return {TransformControls} A reference to this controls.
|
|
53
|
+
*/
|
|
54
|
+
attach(object: Object3D): TransformControls;
|
|
55
|
+
/**
|
|
56
|
+
* Removes the current 3D object from the controls and makes the helper UI invisible.
|
|
57
|
+
*
|
|
58
|
+
* @return {TransformControls} A reference to this controls.
|
|
59
|
+
*/
|
|
60
|
+
detach(): TransformControls;
|
|
61
|
+
/**
|
|
62
|
+
* Resets the object's position, rotation and scale to when the current transform began.
|
|
63
|
+
*/
|
|
64
|
+
reset(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the raycaster that is used for user interaction. This object is shared between all
|
|
67
|
+
* instances of `TransformControls`.
|
|
68
|
+
*
|
|
69
|
+
* @returns {Raycaster} The internal raycaster.
|
|
70
|
+
*/
|
|
71
|
+
getRaycaster(): Raycaster;
|
|
72
|
+
/**
|
|
73
|
+
* Returns the transformation mode.
|
|
74
|
+
*
|
|
75
|
+
* @returns {'translate'|'rotate'|'scale'} The transformation mode.
|
|
76
|
+
*/
|
|
77
|
+
getMode(): "translate" | "rotate" | "scale";
|
|
78
|
+
/**
|
|
79
|
+
* Sets the given transformation mode.
|
|
80
|
+
*
|
|
81
|
+
* @param {'translate'|'rotate'|'scale'} mode - The transformation mode to set.
|
|
82
|
+
*/
|
|
83
|
+
setMode(mode: "translate" | "rotate" | "scale"): void;
|
|
84
|
+
mode: "translate" | "rotate" | "scale" | undefined;
|
|
85
|
+
/**
|
|
86
|
+
* Sets the translation snap.
|
|
87
|
+
*
|
|
88
|
+
* @param {?number} translationSnap - The translation snap to set.
|
|
89
|
+
*/
|
|
90
|
+
setTranslationSnap(translationSnap: number | null): void;
|
|
91
|
+
translationSnap: number | null | undefined;
|
|
92
|
+
/**
|
|
93
|
+
* Sets the rotation snap.
|
|
94
|
+
*
|
|
95
|
+
* @param {?number} rotationSnap - The rotation snap to set.
|
|
96
|
+
*/
|
|
97
|
+
setRotationSnap(rotationSnap: number | null): void;
|
|
98
|
+
rotationSnap: number | null | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the scale snap.
|
|
101
|
+
*
|
|
102
|
+
* @param {?number} scaleSnap - The scale snap to set.
|
|
103
|
+
*/
|
|
104
|
+
setScaleSnap(scaleSnap: number | null): void;
|
|
105
|
+
scaleSnap: number | null | undefined;
|
|
106
|
+
/**
|
|
107
|
+
* Sets the size of the helper UI.
|
|
108
|
+
*
|
|
109
|
+
* @param {number} size - The size to set.
|
|
110
|
+
*/
|
|
111
|
+
setSize(size: number): void;
|
|
112
|
+
size: number | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Sets the coordinate space in which transformations are applied.
|
|
115
|
+
*
|
|
116
|
+
* @param {'world'|'local'} space - The space to set.
|
|
117
|
+
*/
|
|
118
|
+
setSpace(space: "world" | "local"): void;
|
|
119
|
+
space: "world" | "local" | undefined;
|
|
120
|
+
}
|
|
121
|
+
export class TransformControlsGizmo extends Object3D<import("three").Event> {
|
|
122
|
+
constructor();
|
|
123
|
+
isTransformControlsGizmo: boolean;
|
|
124
|
+
gizmo: {};
|
|
125
|
+
picker: {};
|
|
126
|
+
helper: {};
|
|
127
|
+
updateMatrixWorld(force: any): void;
|
|
128
|
+
}
|
|
129
|
+
export class TransformControlsPlane extends Mesh<BufferGeometry, import("three").Material | import("three").Material[]> {
|
|
130
|
+
constructor();
|
|
131
|
+
isTransformControlsPlane: boolean;
|
|
132
|
+
updateMatrixWorld(force: any): void;
|
|
133
|
+
}
|
|
134
|
+
import { Controls } from './Controls.js';
|
|
135
|
+
declare class TransformControlsRoot extends Object3D<import("three").Event> {
|
|
136
|
+
constructor(controls: any);
|
|
137
|
+
isTransformControlsRoot: boolean;
|
|
138
|
+
controls: any;
|
|
139
|
+
updateMatrixWorld(force: any): void;
|
|
140
|
+
dispose(): void;
|
|
141
|
+
}
|
|
142
|
+
import { Vector3 } from 'three';
|
|
143
|
+
import { Quaternion } from 'three';
|
|
144
|
+
declare function getPointer(event: any): {
|
|
145
|
+
x: number;
|
|
146
|
+
y: number;
|
|
147
|
+
button: any;
|
|
148
|
+
};
|
|
149
|
+
declare function onPointerDown(event: any): void;
|
|
150
|
+
declare function onPointerHover(event: any): void;
|
|
151
|
+
declare function onPointerMove(event: any): void;
|
|
152
|
+
declare function onPointerUp(event: any): void;
|
|
153
|
+
import { Object3D } from 'three';
|
|
154
|
+
import { Raycaster } from 'three';
|
|
155
|
+
import { BufferGeometry } from 'three';
|
|
156
|
+
import { Mesh } from 'three';
|
|
157
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IViewer } from '../../IViewer.js';
|
|
2
|
+
import { Extension } from './Extension.js';
|
|
3
|
+
import { FilteringExtension } from './FilteringExtension.js';
|
|
4
|
+
import { PipelineOptions } from '../pipeline/Pipelines/Pipeline.js';
|
|
5
|
+
import { EdgesPipelineOptions } from '../pipeline/Pipelines/EdgesPipeline.js';
|
|
6
|
+
export declare enum ViewMode {
|
|
7
|
+
DEFAULT = 0,
|
|
8
|
+
SOLID = 1,
|
|
9
|
+
PEN = 2,
|
|
10
|
+
ARCTIC = 3,
|
|
11
|
+
SHADED = 4
|
|
12
|
+
}
|
|
13
|
+
export declare enum ViewModeEvent {
|
|
14
|
+
Changed = "view-mode-changed"
|
|
15
|
+
}
|
|
16
|
+
export interface ViewModeEventPayload {
|
|
17
|
+
[ViewModeEvent.Changed]: ViewMode;
|
|
18
|
+
}
|
|
19
|
+
export type ViewModeOptions = PipelineOptions & EdgesPipelineOptions;
|
|
20
|
+
export declare class ViewModes extends Extension {
|
|
21
|
+
protected filteringExtension: FilteringExtension;
|
|
22
|
+
get inject(): (typeof FilteringExtension)[];
|
|
23
|
+
protected _viewModeOptions: Required<ViewModeOptions>;
|
|
24
|
+
get viewModeOptions(): ViewModeOptions;
|
|
25
|
+
protected _viewMode: ViewMode;
|
|
26
|
+
get viewMode(): ViewMode;
|
|
27
|
+
constructor(viewer: IViewer, filteringExtension: FilteringExtension);
|
|
28
|
+
on<T extends ViewModeEvent>(eventType: T, listener: (arg: ViewModeEventPayload[T]) => void): void;
|
|
29
|
+
setViewMode(viewMode: ViewMode, options?: ViewModeOptions): void;
|
|
30
|
+
protected updateViewModes(viewMode: ViewMode, options?: ViewModeOptions): void;
|
|
31
|
+
protected updateViewModeOptions(options?: ViewModeOptions): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Euler, OrthographicCamera, PerspectiveCamera, Sphere, Vector2, Vector3 } from 'three';
|
|
2
|
+
import { Damper } from '../../utils/Damper.js';
|
|
3
|
+
import { KingSyControls } from './KingSyControls.js';
|
|
4
|
+
import { World } from '../../World.js';
|
|
5
|
+
import { AngleDamper } from '../../utils/AngleDamper.js';
|
|
6
|
+
type MoveType = 'forward' | 'back' | 'left' | 'right' | 'up' | 'down';
|
|
7
|
+
export interface FlyControlsOptions {
|
|
8
|
+
[name: string]: unknown;
|
|
9
|
+
enableLook?: boolean;
|
|
10
|
+
lookSpeed?: number;
|
|
11
|
+
moveSpeed?: number;
|
|
12
|
+
damperDecay?: number;
|
|
13
|
+
relativeUpDown?: boolean;
|
|
14
|
+
}
|
|
15
|
+
declare class FlyControls extends KingSyControls {
|
|
16
|
+
protected _options: Required<FlyControlsOptions>;
|
|
17
|
+
protected _targetCamera: PerspectiveCamera | OrthographicCamera;
|
|
18
|
+
protected container: HTMLElement;
|
|
19
|
+
protected velocity: Vector3;
|
|
20
|
+
protected euler: Euler;
|
|
21
|
+
protected position: Vector3;
|
|
22
|
+
protected goalEuler: Euler;
|
|
23
|
+
protected goalPosition: Vector3;
|
|
24
|
+
protected keyMap: Record<MoveType, boolean>;
|
|
25
|
+
protected contextMenuTriggered: boolean;
|
|
26
|
+
protected eulerXDamper: AngleDamper;
|
|
27
|
+
protected eulerYDamper: AngleDamper;
|
|
28
|
+
protected eulerZDamper: AngleDamper;
|
|
29
|
+
protected positionXDamper: Damper;
|
|
30
|
+
protected positionYDamper: Damper;
|
|
31
|
+
protected positionZDamper: Damper;
|
|
32
|
+
protected _lastTick: number;
|
|
33
|
+
protected _enabled: boolean;
|
|
34
|
+
private _basisTransform;
|
|
35
|
+
private _basisTransformInv;
|
|
36
|
+
protected _minDist: number;
|
|
37
|
+
private world;
|
|
38
|
+
get enabled(): boolean;
|
|
39
|
+
set enabled(value: boolean);
|
|
40
|
+
get options(): FlyControlsOptions;
|
|
41
|
+
set options(value: FlyControlsOptions);
|
|
42
|
+
set targetCamera(target: PerspectiveCamera | OrthographicCamera);
|
|
43
|
+
get up(): Vector3;
|
|
44
|
+
set up(value: Vector3);
|
|
45
|
+
set minDist(value: number);
|
|
46
|
+
constructor(camera: PerspectiveCamera | OrthographicCamera, container: HTMLElement, world: World, options: Required<FlyControlsOptions>);
|
|
47
|
+
isStationary(): boolean;
|
|
48
|
+
update(delta?: number): boolean;
|
|
49
|
+
protected updatePositionRotation(delta: number): void;
|
|
50
|
+
jumpToGoal(): void;
|
|
51
|
+
fitToSphere(sphere: Sphere): void;
|
|
52
|
+
/** The input position and target will be in a basis with (0,0,1) as up */
|
|
53
|
+
fromPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
54
|
+
/** The returned vector needs to be in a basis with (0,0,1) as up */
|
|
55
|
+
getTarget(): Vector3;
|
|
56
|
+
/** The returned vector needs to be in a basis with (0,0,1) as up */
|
|
57
|
+
getPosition(): Vector3;
|
|
58
|
+
/**
|
|
59
|
+
* Gets the current goal position
|
|
60
|
+
*/
|
|
61
|
+
getCurrentPosition(): Vector3;
|
|
62
|
+
/**
|
|
63
|
+
* Gets the point in model coordinates the model should orbit/pivot around.
|
|
64
|
+
*/
|
|
65
|
+
getCurrentTarget(): Vector3;
|
|
66
|
+
/**
|
|
67
|
+
* Sets the smoothing decay time.
|
|
68
|
+
*/
|
|
69
|
+
setDamperDecayTime(decayMilliseconds: number): void;
|
|
70
|
+
moveBy(amount: Vector3): void;
|
|
71
|
+
rotateBy(amount: Vector2): void;
|
|
72
|
+
protected connect(): void;
|
|
73
|
+
protected disconnect(): void;
|
|
74
|
+
dispose(): void;
|
|
75
|
+
protected rotate(euler: Euler): void;
|
|
76
|
+
protected onMouseMove: (event: PointerEvent) => void;
|
|
77
|
+
protected onKeyDown: (event: KeyboardEvent) => void;
|
|
78
|
+
protected onKeyUp: (event: KeyboardEvent) => void;
|
|
79
|
+
protected onContextMenu: () => void;
|
|
80
|
+
protected cancelMove(): void;
|
|
81
|
+
}
|
|
82
|
+
export { FlyControls };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OrthographicCamera, PerspectiveCamera, Sphere, Vector3 } from 'three';
|
|
2
|
+
import EventEmitter from '../../EventEmitter.js';
|
|
3
|
+
export declare abstract class KingSyControls extends EventEmitter {
|
|
4
|
+
protected _up: Vector3;
|
|
5
|
+
protected _minDist: number;
|
|
6
|
+
get up(): Vector3;
|
|
7
|
+
set up(value: Vector3);
|
|
8
|
+
get minDist(): number;
|
|
9
|
+
set minDist(value: number);
|
|
10
|
+
abstract get options(): Partial<Record<string, unknown>>;
|
|
11
|
+
abstract set options(value: Partial<Record<string, unknown>>);
|
|
12
|
+
abstract get enabled(): boolean;
|
|
13
|
+
abstract set enabled(value: boolean);
|
|
14
|
+
abstract set targetCamera(target: PerspectiveCamera | OrthographicCamera);
|
|
15
|
+
abstract isStationary(): boolean;
|
|
16
|
+
abstract update(delta?: number): boolean;
|
|
17
|
+
abstract jumpToGoal(): void;
|
|
18
|
+
abstract fitToSphere(sphere: Sphere): void;
|
|
19
|
+
abstract dispose(): void;
|
|
20
|
+
abstract fromPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
21
|
+
abstract getTarget(): Vector3;
|
|
22
|
+
abstract getPosition(): Vector3;
|
|
23
|
+
abstract getCurrentTarget(): Vector3;
|
|
24
|
+
abstract getCurrentPosition(): Vector3;
|
|
25
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { Matrix3, Spherical, Vector2, Vector3, PerspectiveCamera, Sphere, Matrix4, OrthographicCamera, Quaternion, Mesh } from 'three';
|
|
2
|
+
import { Damper } from '../../utils/Damper.js';
|
|
3
|
+
import { World } from '../../World.js';
|
|
4
|
+
import { KingSyControls } from './KingSyControls.js';
|
|
5
|
+
import KingSyRenderer from '../../KingSyRenderer.js';
|
|
6
|
+
import { ExtendedMeshIntersection } from '../../objects/KingSyRaycaster.js';
|
|
7
|
+
export type TouchMode = null | ((dx: number, dy: number) => void);
|
|
8
|
+
export type TouchAction = 'pan-y' | 'pan-x' | 'none';
|
|
9
|
+
export interface Pointer {
|
|
10
|
+
clientX: number;
|
|
11
|
+
clientY: number;
|
|
12
|
+
id: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SmoothOrbitControlsOptions {
|
|
15
|
+
enableOrbit?: boolean;
|
|
16
|
+
enableZoom?: boolean;
|
|
17
|
+
enablePan?: boolean;
|
|
18
|
+
orbitSensitivity?: number;
|
|
19
|
+
zoomSensitivity?: number;
|
|
20
|
+
panSensitivity?: number;
|
|
21
|
+
inputSensitivity?: number;
|
|
22
|
+
minimumRadius?: number;
|
|
23
|
+
maximumRadius?: number;
|
|
24
|
+
minimumPolarAngle?: number;
|
|
25
|
+
maximumPolarAngle?: number;
|
|
26
|
+
minimumAzimuthalAngle?: number;
|
|
27
|
+
maximumAzimuthalAngle?: number;
|
|
28
|
+
minimumFieldOfView?: number;
|
|
29
|
+
maximumFieldOfView?: number;
|
|
30
|
+
touchAction?: TouchAction;
|
|
31
|
+
infiniteZoom?: boolean;
|
|
32
|
+
zoomToCursor?: boolean;
|
|
33
|
+
orbitAroundCursor?: boolean;
|
|
34
|
+
showOrbitPoint?: boolean;
|
|
35
|
+
damperDecay?: number;
|
|
36
|
+
}
|
|
37
|
+
export declare enum PointerChangeEvent {
|
|
38
|
+
PointerChangeStart = "pointer-change-start",
|
|
39
|
+
PointerChangeEnd = "pointer-change-end"
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* SmoothControls is a Three.js helper for adding delightful pointer and
|
|
43
|
+
* keyboard-based input to a staged Three.js scene. Its API is very similar to
|
|
44
|
+
* OrbitControls, but it offers more opinionated (subjectively more delightful)
|
|
45
|
+
* defaults, easy extensibility and subjectively better out-of-the-box keyboard
|
|
46
|
+
* support.
|
|
47
|
+
*
|
|
48
|
+
* One important change compared to OrbitControls is that the `update` method
|
|
49
|
+
* of SmoothControls must be invoked on every frame, otherwise the controls
|
|
50
|
+
* will not have an effect.
|
|
51
|
+
*
|
|
52
|
+
* Another notable difference compared to OrbitControls is that SmoothControls
|
|
53
|
+
* does not currently support panning (but probably will in a future revision).
|
|
54
|
+
*
|
|
55
|
+
* Like OrbitControls, SmoothControls assumes that the orientation of the camera
|
|
56
|
+
* has been set in terms of position, rotation and scale, so it is important to
|
|
57
|
+
* ensure that the camera's matrixWorld is in sync before using SmoothControls.
|
|
58
|
+
*/
|
|
59
|
+
export declare class SmoothOrbitControls extends KingSyControls {
|
|
60
|
+
protected _enabled: boolean;
|
|
61
|
+
protected _options: Required<SmoothOrbitControlsOptions>;
|
|
62
|
+
protected isUserPointing: boolean;
|
|
63
|
+
enablePan: boolean;
|
|
64
|
+
enableTap: boolean;
|
|
65
|
+
protected panProjection: Matrix3;
|
|
66
|
+
protected panPerPixel: number;
|
|
67
|
+
spherical: Spherical;
|
|
68
|
+
protected goalSpherical: Spherical;
|
|
69
|
+
protected origin: Vector3;
|
|
70
|
+
protected pivotalOrigin: Vector3;
|
|
71
|
+
protected goalOrigin: Vector3;
|
|
72
|
+
protected targetDamperX: Damper;
|
|
73
|
+
protected targetDamperY: Damper;
|
|
74
|
+
protected targetDamperZ: Damper;
|
|
75
|
+
protected thetaDamper: Damper;
|
|
76
|
+
protected phiDamper: Damper;
|
|
77
|
+
protected radiusDamper: Damper;
|
|
78
|
+
protected logFov: number;
|
|
79
|
+
protected goalLogFov: number;
|
|
80
|
+
protected fovDamper: Damper;
|
|
81
|
+
protected touchMode: TouchMode;
|
|
82
|
+
protected pointers: Pointer[];
|
|
83
|
+
protected startPointerPosition: {
|
|
84
|
+
clientX: number;
|
|
85
|
+
clientY: number;
|
|
86
|
+
};
|
|
87
|
+
protected lastSeparation: number;
|
|
88
|
+
protected touchDecided: boolean;
|
|
89
|
+
protected zoomControlCoord: Vector2;
|
|
90
|
+
protected _targetCamera: PerspectiveCamera | OrthographicCamera;
|
|
91
|
+
protected _container: HTMLElement;
|
|
92
|
+
protected _lastTick: number;
|
|
93
|
+
protected _basisTransform: Matrix4;
|
|
94
|
+
protected _basisTransformInv: Matrix4;
|
|
95
|
+
protected _radiusDelta: number;
|
|
96
|
+
protected world: World;
|
|
97
|
+
protected renderer: KingSyRenderer;
|
|
98
|
+
protected orbitSphere: Mesh;
|
|
99
|
+
protected pivotPoint: Vector3;
|
|
100
|
+
protected lastPivotPoint: Vector3;
|
|
101
|
+
protected usePivotal: boolean;
|
|
102
|
+
protected _minDist: number;
|
|
103
|
+
get enabled(): boolean;
|
|
104
|
+
set enabled(value: boolean);
|
|
105
|
+
get up(): Vector3;
|
|
106
|
+
set up(value: Vector3);
|
|
107
|
+
constructor(camera: PerspectiveCamera | OrthographicCamera, container: HTMLElement, world: World, renderer: KingSyRenderer, options: Required<SmoothOrbitControlsOptions>);
|
|
108
|
+
/**
|
|
109
|
+
* The options that are currently configured for the controls instance.
|
|
110
|
+
*/
|
|
111
|
+
get options(): Required<SmoothOrbitControlsOptions>;
|
|
112
|
+
set options(value: SmoothOrbitControlsOptions);
|
|
113
|
+
set targetCamera(value: PerspectiveCamera | OrthographicCamera);
|
|
114
|
+
set minDist(value: number);
|
|
115
|
+
/** The input position and target will be in a basis with (0,1,0) as up */
|
|
116
|
+
fromPositionAndTarget(position: Vector3, target: Vector3): void;
|
|
117
|
+
/**
|
|
118
|
+
* Move the camera instantly instead of accelerating toward the goal
|
|
119
|
+
* parameters.
|
|
120
|
+
*/
|
|
121
|
+
jumpToGoal(): void;
|
|
122
|
+
fitToSphere(sphere: Sphere): void;
|
|
123
|
+
/**
|
|
124
|
+
* Gets the current goal position
|
|
125
|
+
*/
|
|
126
|
+
getPosition(): Vector3;
|
|
127
|
+
/**
|
|
128
|
+
* Gets the point in model coordinates the model should orbit/pivot around.
|
|
129
|
+
*/
|
|
130
|
+
getTarget(): Vector3;
|
|
131
|
+
/**
|
|
132
|
+
* Gets the current goal position
|
|
133
|
+
*/
|
|
134
|
+
getCurrentPosition(): Vector3;
|
|
135
|
+
/**
|
|
136
|
+
* Gets the point in model coordinates the model should orbit/pivot around.
|
|
137
|
+
*/
|
|
138
|
+
getCurrentTarget(): Vector3;
|
|
139
|
+
isStationary(): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Configure the _options of the controls. Configured _options will be
|
|
142
|
+
* merged with whatever _options have already been configured for this
|
|
143
|
+
* controls instance.
|
|
144
|
+
*/
|
|
145
|
+
protected applyOptions(_options: SmoothOrbitControlsOptions): void;
|
|
146
|
+
/** Computes min/max radius values based on the current world size */
|
|
147
|
+
protected computeMinMaxRadius(): void;
|
|
148
|
+
/**
|
|
149
|
+
* Set the absolute orbital goal of the camera. The change will be
|
|
150
|
+
* applied over a number of frames depending on configured acceleration and
|
|
151
|
+
* dampening _options.
|
|
152
|
+
*
|
|
153
|
+
* Returns true if invoking the method will result in the camera changing
|
|
154
|
+
* position and/or rotation, otherwise false.
|
|
155
|
+
*/
|
|
156
|
+
setOrbit(goalTheta?: number, goalPhi?: number, goalRadius?: number): boolean;
|
|
157
|
+
/**
|
|
158
|
+
* Subset of setOrbit() above, which only sets the camera's radius.
|
|
159
|
+
*/
|
|
160
|
+
setRadius(radius: number): void;
|
|
161
|
+
/**
|
|
162
|
+
* Sets the goal field of view for the camera
|
|
163
|
+
*/
|
|
164
|
+
setFieldOfView(fov: number): void;
|
|
165
|
+
/**
|
|
166
|
+
* Sets the smoothing decay time.
|
|
167
|
+
*/
|
|
168
|
+
setDamperDecayTime(decayMilliseconds: number): void;
|
|
169
|
+
/**
|
|
170
|
+
* Sets the point in model coordinates the object should orbit/pivot around.
|
|
171
|
+
*/
|
|
172
|
+
setTarget(x: number, y: number, z: number): void;
|
|
173
|
+
/**
|
|
174
|
+
* Adjust the orbital position of the camera relative to its current orbital
|
|
175
|
+
* position. Does not let the theta goal get more than pi ahead of the current
|
|
176
|
+
* theta, which ensures interpolation continues in the direction of the delta.
|
|
177
|
+
* The deltaZoom parameter adjusts both the field of view and the orbit radius
|
|
178
|
+
* such that they progress across their allowed ranges in sync.
|
|
179
|
+
*/
|
|
180
|
+
adjustOrbit(deltaTheta: number, deltaPhi: number, deltaZoom: number): void;
|
|
181
|
+
/**
|
|
182
|
+
* Update controls. In most cases, this will result in the camera
|
|
183
|
+
* interpolating its position and rotation until it lines up with the
|
|
184
|
+
* designated goal orbital position. Returns false if the camera did not move.
|
|
185
|
+
*
|
|
186
|
+
* Time and delta are measured in milliseconds.
|
|
187
|
+
*/
|
|
188
|
+
update(delta?: number): boolean;
|
|
189
|
+
/** Function expects the position argument to be in a CS where Y is up */
|
|
190
|
+
protected polarFromPivotal(position: Vector3): void;
|
|
191
|
+
/** Function expects the origin argument to be in a CS where Y is up */
|
|
192
|
+
protected positionFromPivotal(origin: Vector3, quaternion: Quaternion): Vector3;
|
|
193
|
+
/** Function expects the pivotPoint and position arguments to be in a CS where Y is up */
|
|
194
|
+
protected getPivotalOrigin(pivotPoint: Vector3, position: Vector3, quaternion: Quaternion): Vector3;
|
|
195
|
+
protected moveCamera(): boolean;
|
|
196
|
+
/** Three.js Spherical assumes (0, 1, 0) as up... */
|
|
197
|
+
protected positionFromSpherical(spherical: Spherical, origin?: Vector3): Vector3;
|
|
198
|
+
/** Three.js Spherical assumes (0, 1, 0) as up... */
|
|
199
|
+
protected quaternionFromSpherical(spherical: Spherical): Quaternion;
|
|
200
|
+
protected userAdjustOrbit(deltaTheta: number, deltaPhi: number, deltaZoom: number): void;
|
|
201
|
+
protected enableInteraction(): void;
|
|
202
|
+
protected disableInteraction(): void;
|
|
203
|
+
protected wrapAngle(radians: number): number;
|
|
204
|
+
protected pixelLengthToSphericalAngle(pixelLength: number): number;
|
|
205
|
+
protected twoTouchDistance(touchOne: Pointer, touchTwo: Pointer): number;
|
|
206
|
+
protected touchModeZoom: TouchMode;
|
|
207
|
+
protected disableScroll: (event: TouchEvent) => void;
|
|
208
|
+
protected touchModeRotate: TouchMode;
|
|
209
|
+
protected handleSinglePointerMove(dx: number, dy: number): void;
|
|
210
|
+
protected initializePan(): void;
|
|
211
|
+
protected movePan(dx: number, dy: number): void;
|
|
212
|
+
/** By default hidden objects are ignored when picking for orbit around cursor */
|
|
213
|
+
protected filterOrbitToCursorHits(hit: ExtendedMeshIntersection): boolean;
|
|
214
|
+
protected onPointerDown: (event: PointerEvent) => void;
|
|
215
|
+
protected onPointerMove: (event: PointerEvent) => void;
|
|
216
|
+
protected onPointerUp: (event: PointerEvent) => void;
|
|
217
|
+
protected onTouchChange(event: PointerEvent): void;
|
|
218
|
+
protected onMouseDown(event: MouseEvent): void;
|
|
219
|
+
protected onWheel: (event: WheelEvent) => void;
|
|
220
|
+
protected onContext: (event: MouseEvent) => void;
|
|
221
|
+
dispose(): void;
|
|
222
|
+
}
|