@tomorrowevening/hermes 0.0.100 → 0.0.102

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,107 +1,109 @@
1
- import { Component, ReactNode } from 'react';
2
- import { Camera, Object3D, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
3
- import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
4
- import RemoteThree from '@/core/remote/RemoteThree';
5
- import { InteractionMode, MultiViewMode } from './MultiViewData';
6
- import './MultiView.scss';
7
- type MultiViewProps = {
8
- three: RemoteThree;
9
- scenes: Map<string, any>;
10
- onSceneSet?: (scene: Scene) => void;
11
- onSceneUpdate?: (scene: Scene) => void;
12
- onSceneResize?: (scene: Scene, width: number, height: number) => void;
13
- };
14
- type MultiViewState = {
15
- mode: MultiViewMode;
16
- modeOpen: boolean;
17
- renderModeOpen: boolean;
18
- interactionMode: InteractionMode;
19
- interactionModeOpen: boolean;
20
- lastUpdate: number;
21
- };
22
- export default class MultiView extends Component<MultiViewProps, MultiViewState> {
23
- static instance: MultiView | null;
24
- scene: Scene;
25
- renderer?: WebGLRenderer | null;
26
- currentScene?: Scene;
27
- cameras: Map<string, Camera>;
28
- controls: Map<string, OrbitControls>;
29
- currentCamera: PerspectiveCamera | OrthographicCamera;
30
- private cameraHelpers;
31
- private lightHelpers;
32
- private helpersContainer;
33
- private grid;
34
- private axisHelper;
35
- private interactionHelper;
36
- private currentTransform?;
37
- private depthMaterial;
38
- private normalsMaterial;
39
- private uvMaterial;
40
- private wireframeMaterial;
41
- private playing;
42
- private rafID;
43
- private width;
44
- private height;
45
- private sceneSet;
46
- private tlCam;
47
- private trCam;
48
- private blCam;
49
- private brCam;
50
- private tlRender;
51
- private trRender;
52
- private blRender;
53
- private brRender;
54
- selectedItem: Object3D | undefined;
55
- private debugCamera;
56
- private raycaster;
57
- private pointer;
58
- private cameraControls;
59
- private canvasRef;
60
- private containerRef;
61
- private tlWindow;
62
- private trWindow;
63
- private blWindow;
64
- private brWindow;
65
- private currentWindow;
66
- constructor(props: MultiViewProps);
67
- componentDidMount(): void;
68
- componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
69
- componentWillUnmount(): void;
70
- render(): ReactNode;
71
- private setupRenderer;
72
- private setupScene;
73
- play(): void;
74
- pause(): void;
75
- toggleOrbitControls(value: boolean): void;
76
- private update;
77
- private draw;
78
- private onUpdate;
79
- private enable;
80
- private disable;
81
- private resize;
82
- private sceneUpdate;
83
- private addCamera;
84
- private removeCamera;
85
- private onMouseMove;
86
- private onClick;
87
- private onKey;
88
- private onSetSelectedItem;
89
- private onUpdateTransform;
90
- private clearLightHelpers;
91
- private addLightHelpers;
92
- private createControls;
93
- private clearCamera;
94
- private killControls;
95
- private assignControls;
96
- private updateCamera;
97
- private updateCameraControls;
98
- private clearControls;
99
- private getSceneOverride;
100
- private drawSingle;
101
- private drawDouble;
102
- private drawQuad;
103
- get appID(): string;
104
- get mode(): MultiViewMode;
105
- get three(): RemoteThree;
106
- }
107
- export {};
1
+ import { Component, ReactNode } from 'react';
2
+ import { Camera, Object3D, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from 'three';
3
+ import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls';
4
+ import RemoteThree from '@/core/remote/RemoteThree';
5
+ import { InteractionMode, MultiViewMode } from './MultiViewData';
6
+ import './MultiView.scss';
7
+ type MultiViewProps = {
8
+ three: RemoteThree;
9
+ scenes: Map<string, any>;
10
+ onSceneSet?: (scene: Scene) => void;
11
+ onSceneUpdate?: (scene: Scene) => void;
12
+ onSceneResize?: (scene: Scene, width: number, height: number) => void;
13
+ };
14
+ type MultiViewState = {
15
+ mode: MultiViewMode;
16
+ modeOpen: boolean;
17
+ renderModeOpen: boolean;
18
+ interactionMode: InteractionMode;
19
+ interactionModeOpen: boolean;
20
+ lastUpdate: number;
21
+ };
22
+ export default class MultiView extends Component<MultiViewProps, MultiViewState> {
23
+ static instance: MultiView | null;
24
+ scene: Scene;
25
+ renderer?: WebGLRenderer | null;
26
+ currentScene?: Scene;
27
+ cameras: Map<string, Camera>;
28
+ controls: Map<string, OrbitControls>;
29
+ currentCamera: PerspectiveCamera | OrthographicCamera;
30
+ currentWindow: any;
31
+ private cameraHelpers;
32
+ private lightHelpers;
33
+ private helpersContainer;
34
+ private grid;
35
+ private axisHelper;
36
+ private interactionHelper;
37
+ private currentTransform?;
38
+ private splineEditor;
39
+ private depthMaterial;
40
+ private normalsMaterial;
41
+ private uvMaterial;
42
+ private wireframeMaterial;
43
+ private playing;
44
+ private rafID;
45
+ private width;
46
+ private height;
47
+ private sceneSet;
48
+ private tlCam;
49
+ private trCam;
50
+ private blCam;
51
+ private brCam;
52
+ private tlRender;
53
+ private trRender;
54
+ private blRender;
55
+ private brRender;
56
+ selectedItem: Object3D | undefined;
57
+ private debugCamera;
58
+ private raycaster;
59
+ private pointer;
60
+ private cameraControls;
61
+ private canvasRef;
62
+ private containerRef;
63
+ private tlWindow;
64
+ private trWindow;
65
+ private blWindow;
66
+ private brWindow;
67
+ constructor(props: MultiViewProps);
68
+ componentDidMount(): void;
69
+ componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
70
+ componentWillUnmount(): void;
71
+ render(): ReactNode;
72
+ private setupRenderer;
73
+ private setupScene;
74
+ private setupTools;
75
+ play(): void;
76
+ pause(): void;
77
+ toggleOrbitControls(value: boolean): void;
78
+ private update;
79
+ private draw;
80
+ private onUpdate;
81
+ private enable;
82
+ private disable;
83
+ private resize;
84
+ private sceneUpdate;
85
+ private addCamera;
86
+ private removeCamera;
87
+ private onMouseMove;
88
+ private onClick;
89
+ private onKey;
90
+ private onSetSelectedItem;
91
+ private onUpdateTransform;
92
+ private clearLightHelpers;
93
+ private addLightHelpers;
94
+ private createControls;
95
+ private clearCamera;
96
+ private killControls;
97
+ private assignControls;
98
+ private updateCamera;
99
+ private updateCameraControls;
100
+ private clearControls;
101
+ private getSceneOverride;
102
+ private drawSingle;
103
+ private drawDouble;
104
+ private drawQuad;
105
+ get appID(): string;
106
+ get mode(): MultiViewMode;
107
+ get three(): RemoteThree;
108
+ }
109
+ export {};
@@ -1,23 +1,24 @@
1
- import { Component, ReactNode } from 'react';
2
- import RemoteThree from '@/core/remote/RemoteThree';
3
- import { GroupData } from '@/core/types';
4
- interface DebugDataProps {
5
- three: RemoteThree;
6
- }
7
- type DebugDataState = {
8
- groups: any[];
9
- groupTitles: string[];
10
- lastUpdate: number;
11
- };
12
- export default class DebugData extends Component<DebugDataProps, DebugDataState> {
13
- static instance: DebugData | null;
14
- constructor(props: DebugDataProps);
15
- componentDidMount(): void;
16
- componentWillUnmount(): void;
17
- render(): ReactNode;
18
- private addGroup;
19
- private removeGroup;
20
- static addEditorGroup(data: GroupData): void;
21
- static removeEditorGroup(name: string): void;
22
- }
23
- export {};
1
+ import { Component, ReactNode, RefObject } from 'react';
2
+ import RemoteThree from '@/core/remote/RemoteThree';
3
+ import { GroupData } from '@/core/types';
4
+ import InspectorGroup from './inspector/InspectorGroup';
5
+ interface DebugDataProps {
6
+ three: RemoteThree;
7
+ }
8
+ type DebugDataState = {
9
+ lastUpdate: number;
10
+ };
11
+ export default class DebugData extends Component<DebugDataProps, DebugDataState> {
12
+ static instance: DebugData;
13
+ static groups: JSX.Element[];
14
+ static groupsRefs: RefObject<InspectorGroup>[];
15
+ static groupTitles: string[];
16
+ constructor(props: DebugDataProps);
17
+ componentWillUnmount(): void;
18
+ render(): ReactNode;
19
+ private addGroup;
20
+ private removeGroup;
21
+ static addEditorGroup(data: GroupData): RefObject<InspectorGroup> | null;
22
+ static removeEditorGroup(name: string): void;
23
+ }
24
+ export {};
@@ -1,8 +1,23 @@
1
- import { InspectorFieldProps } from './InspectorField';
2
- export interface InspectorGroupProps {
3
- title: string;
4
- expanded?: boolean;
5
- items: InspectorFieldProps[] | InspectorGroupProps[];
6
- onToggle?: (value: boolean) => void;
7
- }
8
- export default function InspectorGroup(props: InspectorGroupProps): import("react/jsx-runtime").JSX.Element;
1
+ import { Component, ReactNode, RefObject } from 'react';
2
+ import { InspectorFieldProps } from './InspectorField';
3
+ import { GroupData } from '@/core/types';
4
+ export interface InspectorGroupProps {
5
+ title: string;
6
+ expanded?: boolean;
7
+ items: InspectorFieldProps[] | InspectorGroupProps[];
8
+ onToggle?: (value: boolean) => void;
9
+ }
10
+ type InspectorGroupState = {
11
+ lastUpdated: number;
12
+ };
13
+ export default class InspectorGroup extends Component<InspectorGroupProps, InspectorGroupState> {
14
+ subgroupNames: string[];
15
+ subgroupElements: JSX.Element[];
16
+ valueOverrides: Map<string, any>;
17
+ constructor(props: InspectorGroupProps);
18
+ addGroup(data: GroupData): RefObject<InspectorGroup>;
19
+ removeGroup(name: string): void;
20
+ setField(name: string, value: any): void;
21
+ render(): ReactNode;
22
+ }
23
+ export {};
@@ -1,23 +1,25 @@
1
- import { Euler, Matrix4, Vector3 } from 'three';
2
- import { Component, ReactNode } from 'react';
3
- import { RemoteObject } from '../../types';
4
- type InspectTransformProps = {
5
- object: RemoteObject;
6
- };
7
- type InspectTransformState = {
8
- lastUpdated: number;
9
- expanded: boolean;
10
- };
11
- export declare class InspectTransform extends Component<InspectTransformProps, InspectTransformState> {
12
- static instance: InspectTransform;
13
- matrix: Matrix4;
14
- position: Vector3;
15
- rotation: Euler;
16
- scale: Vector3;
17
- open: boolean;
18
- constructor(props: InspectTransformProps);
19
- update(): void;
20
- render(): ReactNode;
21
- private updateTransform;
22
- }
23
- export {};
1
+ import { Euler, Matrix4, Vector3 } from 'three';
2
+ import { Component, ReactNode } from 'react';
3
+ import { RemoteObject } from '../../types';
4
+ import RemoteThree from '@/core/remote/RemoteThree';
5
+ type InspectTransformProps = {
6
+ object: RemoteObject;
7
+ three: RemoteThree;
8
+ };
9
+ type InspectTransformState = {
10
+ lastUpdated: number;
11
+ expanded: boolean;
12
+ };
13
+ export declare class InspectTransform extends Component<InspectTransformProps, InspectTransformState> {
14
+ static instance: InspectTransform;
15
+ matrix: Matrix4;
16
+ position: Vector3;
17
+ rotation: Euler;
18
+ scale: Vector3;
19
+ open: boolean;
20
+ constructor(props: InspectTransformProps);
21
+ update(): void;
22
+ render(): ReactNode;
23
+ private updateTransform;
24
+ }
25
+ export {};
@@ -1,22 +1,22 @@
1
- import { Camera, EventDispatcher } from 'three';
2
- import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
3
- import RemoteThree from '@/core/remote/RemoteThree';
4
- export default class Transform extends EventDispatcher {
5
- static DRAG_START: string;
6
- static DRAG_END: string;
7
- private static _instance;
8
- three: RemoteThree;
9
- activeCamera: Camera;
10
- controls: Map<string, TransformControls>;
11
- private visibility;
12
- private groups;
13
- clear(): void;
14
- add(name: string): TransformControls;
15
- get(name: string): TransformControls | undefined;
16
- remove(name: string): boolean;
17
- enabled(value: boolean): void;
18
- updateCamera(camera: Camera, element: HTMLElement): void;
19
- show(): void;
20
- hide(): void;
21
- static get instance(): Transform;
22
- }
1
+ import { Camera, EventDispatcher } from 'three';
2
+ import { TransformControls } from 'three/examples/jsm/controls/TransformControls';
3
+ import RemoteThree from '@/core/remote/RemoteThree';
4
+ export default class Transform extends EventDispatcher {
5
+ static DRAG_START: string;
6
+ static DRAG_END: string;
7
+ private static _instance;
8
+ three: RemoteThree;
9
+ activeCamera: Camera;
10
+ controls: Map<string, TransformControls>;
11
+ private visibility;
12
+ private groups;
13
+ clear(): void;
14
+ add(name: string): TransformControls;
15
+ get(name: string): TransformControls | undefined;
16
+ remove(name: string): boolean;
17
+ enabled(value: boolean): void;
18
+ updateCamera(camera: Camera, element: HTMLElement): void;
19
+ show(): void;
20
+ hide(): void;
21
+ static get instance(): Transform;
22
+ }
@@ -0,0 +1,52 @@
1
+ import { Camera, CatmullRomCurve3, Line, Mesh, Object3D, Vector3 } from 'three';
2
+ import InspectorGroup from '@/editor/sidePanel/inspector/InspectorGroup';
3
+ export type CurveType = 'catmullrom' | 'centripetal' | 'chordal';
4
+ export default class Spline extends Object3D {
5
+ curve: CatmullRomCurve3;
6
+ line: Line;
7
+ draggable: Object3D;
8
+ curvePos: Mesh;
9
+ tension: number;
10
+ closed: boolean;
11
+ subdivide: number;
12
+ curveType: CurveType;
13
+ offset: number;
14
+ private lineMaterial;
15
+ private _camera;
16
+ private _curvePercentage;
17
+ private _draggableScale;
18
+ private _transform?;
19
+ private raycaster;
20
+ private draggedMat;
21
+ private parentGroup;
22
+ private group;
23
+ constructor(name: string, camera: Camera);
24
+ enable(): void;
25
+ disable(): void;
26
+ dispose: () => void;
27
+ hideTransform: () => void;
28
+ exportSpline: () => void;
29
+ showPoints: (visible?: boolean) => void;
30
+ addPoints: (pts?: Array<Vector3>) => void;
31
+ addPoint: (position: Vector3, update?: boolean) => Mesh;
32
+ addNextPt: () => void;
33
+ removePoint: (child: Object3D) => void;
34
+ removePointAt: (index: number) => void;
35
+ removeSelectedPt: () => void;
36
+ updateSpline: () => void;
37
+ private onMouseClick;
38
+ getPointAt(percentage: number): Vector3;
39
+ getPoints(): Vector3[];
40
+ getTangentAt(percentage: number): Vector3;
41
+ get points(): Array<Vector3>;
42
+ get total(): number;
43
+ get draggableScale(): number;
44
+ set draggableScale(value: number);
45
+ get camera(): Camera;
46
+ set camera(value: Camera);
47
+ get curvePercentage(): number;
48
+ set curvePercentage(value: number);
49
+ private onUpdateTransform;
50
+ initDebug(parentGroup: InspectorGroup): void;
51
+ private debugPoint;
52
+ }
@@ -0,0 +1,27 @@
1
+ import { Camera, CatmullRomCurve3, Object3D, Vector3 } from 'three';
2
+ import Spline from './Spline';
3
+ export type SplineJSON = {
4
+ name: string;
5
+ points: Array<number[]>;
6
+ tension: number;
7
+ closed: boolean;
8
+ subdivide: number;
9
+ type: string;
10
+ };
11
+ export default class SplineEditor extends Object3D {
12
+ defaultScale: number;
13
+ private _camera;
14
+ private group;
15
+ constructor(camera: Camera);
16
+ initDebug(): void;
17
+ dispose(): void;
18
+ addSpline(spline: Spline): void;
19
+ createSpline: (defaultPoints?: Array<Vector3>) => Spline;
20
+ createSplineFromArray: (points: Array<number[]>) => Spline;
21
+ createSplineFromCurve: (curve: CatmullRomCurve3) => Spline;
22
+ createSplineFromJSON: (data: SplineJSON) => Spline;
23
+ showPoints: (visible?: boolean) => void;
24
+ private onAddSpline;
25
+ get camera(): Camera;
26
+ set camera(value: Camera);
27
+ }
@@ -1,31 +1,31 @@
1
- import { Material, Object3D, Texture, WebGLRenderer } from 'three';
2
- export declare function capitalize(value: string): string;
3
- export declare function copyToClipboard(data: any): string;
4
- export declare function clamp(min: number, max: number, value: number): number;
5
- export declare function normalize(min: number, max: number, value: number): number;
6
- export declare function mix(min: number, max: number, value: number): number;
7
- export declare function distance(x: number, y: number): number;
8
- export declare function randomID(): string;
9
- export declare function isColor(obj: any): boolean;
10
- export declare function colorToHex(obj: any): string;
11
- export declare function round(value: number, precision?: number): number;
12
- export declare let totalThreeObjects: number;
13
- export declare const resetThreeObjects: () => void;
14
- export declare const hierarchyUUID: (object: Object3D) => void;
15
- export declare const disposeTexture: (texture?: Texture) => void;
16
- export declare const disposeMaterial: (material?: Material | Material[]) => void;
17
- export declare const dispose: (object: Object3D) => void;
18
- export declare class ExportTexture {
19
- static renderer: WebGLRenderer;
20
- private static canvas;
21
- private static context;
22
- private static scene;
23
- private static camera;
24
- private static material;
25
- private static inited;
26
- private static width;
27
- private static height;
28
- private static init;
29
- static renderToBlob(texture: Texture): string;
30
- private static renderToCanvas;
31
- }
1
+ import { Material, Object3D, Texture, WebGLRenderer } from 'three';
2
+ export declare function capitalize(value: string): string;
3
+ export declare function copyToClipboard(data: any): string;
4
+ export declare function clamp(min: number, max: number, value: number): number;
5
+ export declare function normalize(min: number, max: number, value: number): number;
6
+ export declare function mix(min: number, max: number, value: number): number;
7
+ export declare function distance(x: number, y: number): number;
8
+ export declare function randomID(): string;
9
+ export declare function isColor(obj: any): boolean;
10
+ export declare function colorToHex(obj: any): string;
11
+ export declare function round(value: number, precision?: number): number;
12
+ export declare let totalThreeObjects: number;
13
+ export declare const resetThreeObjects: () => void;
14
+ export declare const hierarchyUUID: (object: Object3D) => void;
15
+ export declare const disposeTexture: (texture?: Texture) => void;
16
+ export declare const disposeMaterial: (material?: Material | Material[]) => void;
17
+ export declare const dispose: (object: Object3D) => void;
18
+ export declare class ExportTexture {
19
+ static renderer: WebGLRenderer;
20
+ private static canvas;
21
+ private static context;
22
+ private static scene;
23
+ private static camera;
24
+ private static material;
25
+ private static inited;
26
+ private static width;
27
+ private static height;
28
+ private static init;
29
+ static renderToBlob(texture: Texture): string;
30
+ private static renderToCanvas;
31
+ }
@@ -1,6 +0,0 @@
1
- import RemoteThree from '@/core/remote/RemoteThree';
2
- interface CustomAccordionProps {
3
- three: RemoteThree;
4
- }
5
- export default function CustomAccordion(props: CustomAccordionProps): import("react/jsx-runtime").JSX.Element;
6
- export {};