@tomorrowevening/hermes 0.0.113 → 0.0.115
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +4 -4
- package/dist/hermes.cjs.js +15 -15
- package/dist/hermes.es.js +1377 -1122
- package/package.json +1 -1
- package/types/core/remote/RemoteThree.d.ts +2 -0
- package/types/core/types.d.ts +1 -1
- package/types/editor/global.d.ts +3 -1
- package/types/editor/multiView/MultiView.d.ts +117 -117
- package/types/editor/sidePanel/inspector/utils/InspectRenderer.d.ts +28 -0
package/package.json
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
"module": "./dist/hermes.esm.js",
|
8
8
|
"types": "./types/index.d.ts",
|
9
9
|
"type": "module",
|
10
|
-
"version": "0.0.
|
10
|
+
"version": "0.0.115",
|
11
11
|
"homepage": "https://github.com/tomorrowevening/hermes#readme",
|
12
12
|
"bugs": {
|
13
13
|
"url": "https://github.com/tomorrowevening/hermes/issues"
|
@@ -19,6 +19,8 @@ export default class RemoteThree extends BaseRemote {
|
|
19
19
|
updateGroup(group: string, prop: string, value: any): void;
|
20
20
|
removeAllGroups(): void;
|
21
21
|
addSpline(spline: Curve<any>): void;
|
22
|
+
addRenderer(value: WebGLRenderer): void;
|
23
|
+
updateRenderer(data: any): void;
|
22
24
|
addScene(value: Scene): void;
|
23
25
|
refreshScene(value: string): void;
|
24
26
|
removeScene(value: Scene): void;
|
package/types/core/types.d.ts
CHANGED
@@ -27,7 +27,7 @@ export interface GroupCallback {
|
|
27
27
|
export type ApplicationMode = 'app' | 'editor';
|
28
28
|
export type VoidCallback = () => void;
|
29
29
|
export type DataUpdateCallback = (data: any) => void;
|
30
|
-
export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'getObject' | 'setObject' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'requestMethod' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'selectComponent' | 'draggableListUpdate' | 'addGroup' | 'removeGroup' | 'updateGroup';
|
30
|
+
export type EditorEvent = 'custom' | 'setSheet' | 'setSheetObject' | 'updateSheetObject' | 'updateTimeline' | 'playSheet' | 'pauseSheet' | 'getObject' | 'setObject' | 'updateObject' | 'addScene' | 'refreshScene' | 'removeScene' | 'setScene' | 'createTexture' | 'requestMethod' | 'addCamera' | 'removeCamera' | 'addSpline' | 'addRenderer' | 'updateRenderer' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'selectComponent' | 'draggableListUpdate' | 'addGroup' | 'removeGroup' | 'updateGroup';
|
31
31
|
export type VoidFunc = () => void;
|
32
32
|
export type BroadcastCallback = (data: BroadcastData) => void;
|
33
33
|
export type TheatreUpdateCallback = (data: any) => void;
|
package/types/editor/global.d.ts
CHANGED
@@ -16,7 +16,9 @@ export declare enum ToolEvents {
|
|
16
16
|
REMOVE_CAMERA = "ToolEvents::removeCamera",
|
17
17
|
ADD_GROUP = "ToolEvents::addGroup",
|
18
18
|
REMOVE_GROUP = "ToolEvents::removeGroup",
|
19
|
-
ADD_SPLINE = "ToolEvents::addSpline"
|
19
|
+
ADD_SPLINE = "ToolEvents::addSpline",
|
20
|
+
ADD_RENDERER = "ToolEvents::addRenderer",
|
21
|
+
UPDATE_RENDERER = "ToolEvents::updateRenderer"
|
20
22
|
}
|
21
23
|
export type ToolEvent = {
|
22
24
|
[key in ToolEvents]: {
|
@@ -1,117 +1,117 @@
|
|
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 cameraControlsRafID;
|
46
|
-
private width;
|
47
|
-
private height;
|
48
|
-
private sceneSet;
|
49
|
-
private tlCam;
|
50
|
-
private trCam;
|
51
|
-
private blCam;
|
52
|
-
private brCam;
|
53
|
-
private tlRender;
|
54
|
-
private trRender;
|
55
|
-
private blRender;
|
56
|
-
private brRender;
|
57
|
-
private cameraVisibility;
|
58
|
-
private lightVisibility;
|
59
|
-
selectedItem: Object3D | undefined;
|
60
|
-
private debugCamera;
|
61
|
-
private raycaster;
|
62
|
-
private pointer;
|
63
|
-
private cameraControls;
|
64
|
-
private canvasRef;
|
65
|
-
private containerRef;
|
66
|
-
private tlWindow;
|
67
|
-
private trWindow;
|
68
|
-
private blWindow;
|
69
|
-
private brWindow;
|
70
|
-
constructor(props: MultiViewProps);
|
71
|
-
componentDidMount(): void;
|
72
|
-
componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
|
73
|
-
componentWillUnmount(): void;
|
74
|
-
render(): ReactNode;
|
75
|
-
private setupRenderer;
|
76
|
-
private setupScene;
|
77
|
-
private setupTools;
|
78
|
-
play(): void;
|
79
|
-
pause(): void;
|
80
|
-
toggleOrbitControls(value: boolean): void;
|
81
|
-
private update;
|
82
|
-
private draw;
|
83
|
-
private onUpdate;
|
84
|
-
private enable;
|
85
|
-
private disable;
|
86
|
-
private resize;
|
87
|
-
private sceneUpdate;
|
88
|
-
private addCamera;
|
89
|
-
private removeCamera;
|
90
|
-
private onMouseMove;
|
91
|
-
private onClick;
|
92
|
-
private onKey;
|
93
|
-
private onSetSelectedItem;
|
94
|
-
private updateSelectedItemHelper;
|
95
|
-
private onUpdateTransform;
|
96
|
-
private clearLightHelpers;
|
97
|
-
private addLightHelpers;
|
98
|
-
private createControls;
|
99
|
-
private clearCamera;
|
100
|
-
private killControls;
|
101
|
-
private assignControls;
|
102
|
-
private updateCamera;
|
103
|
-
private updateCameraControls;
|
104
|
-
private clearControls;
|
105
|
-
private saveExpandedCameraVisibility;
|
106
|
-
private saveExpandedLightVisibility;
|
107
|
-
private getSceneOverride;
|
108
|
-
private drawSingle;
|
109
|
-
private drawDouble;
|
110
|
-
private drawQuad;
|
111
|
-
get appID(): string;
|
112
|
-
get mode(): MultiViewMode;
|
113
|
-
get three(): RemoteThree;
|
114
|
-
get expandedCameraVisibility(): string;
|
115
|
-
get expandedLightVisibility(): string;
|
116
|
-
}
|
117
|
-
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 cameraControlsRafID;
|
46
|
+
private width;
|
47
|
+
private height;
|
48
|
+
private sceneSet;
|
49
|
+
private tlCam;
|
50
|
+
private trCam;
|
51
|
+
private blCam;
|
52
|
+
private brCam;
|
53
|
+
private tlRender;
|
54
|
+
private trRender;
|
55
|
+
private blRender;
|
56
|
+
private brRender;
|
57
|
+
private cameraVisibility;
|
58
|
+
private lightVisibility;
|
59
|
+
selectedItem: Object3D | undefined;
|
60
|
+
private debugCamera;
|
61
|
+
private raycaster;
|
62
|
+
private pointer;
|
63
|
+
private cameraControls;
|
64
|
+
private canvasRef;
|
65
|
+
private containerRef;
|
66
|
+
private tlWindow;
|
67
|
+
private trWindow;
|
68
|
+
private blWindow;
|
69
|
+
private brWindow;
|
70
|
+
constructor(props: MultiViewProps);
|
71
|
+
componentDidMount(): void;
|
72
|
+
componentDidUpdate(prevProps: Readonly<MultiViewProps>, prevState: Readonly<MultiViewState>, snapshot?: any): void;
|
73
|
+
componentWillUnmount(): void;
|
74
|
+
render(): ReactNode;
|
75
|
+
private setupRenderer;
|
76
|
+
private setupScene;
|
77
|
+
private setupTools;
|
78
|
+
play(): void;
|
79
|
+
pause(): void;
|
80
|
+
toggleOrbitControls(value: boolean): void;
|
81
|
+
private update;
|
82
|
+
private draw;
|
83
|
+
private onUpdate;
|
84
|
+
private enable;
|
85
|
+
private disable;
|
86
|
+
private resize;
|
87
|
+
private sceneUpdate;
|
88
|
+
private addCamera;
|
89
|
+
private removeCamera;
|
90
|
+
private onMouseMove;
|
91
|
+
private onClick;
|
92
|
+
private onKey;
|
93
|
+
private onSetSelectedItem;
|
94
|
+
private updateSelectedItemHelper;
|
95
|
+
private onUpdateTransform;
|
96
|
+
private clearLightHelpers;
|
97
|
+
private addLightHelpers;
|
98
|
+
private createControls;
|
99
|
+
private clearCamera;
|
100
|
+
private killControls;
|
101
|
+
private assignControls;
|
102
|
+
private updateCamera;
|
103
|
+
private updateCameraControls;
|
104
|
+
private clearControls;
|
105
|
+
private saveExpandedCameraVisibility;
|
106
|
+
private saveExpandedLightVisibility;
|
107
|
+
private getSceneOverride;
|
108
|
+
private drawSingle;
|
109
|
+
private drawDouble;
|
110
|
+
private drawQuad;
|
111
|
+
get appID(): string;
|
112
|
+
get mode(): MultiViewMode;
|
113
|
+
get three(): RemoteThree;
|
114
|
+
get expandedCameraVisibility(): string;
|
115
|
+
get expandedLightVisibility(): string;
|
116
|
+
}
|
117
|
+
export {};
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { Component, ReactNode } from 'react';
|
2
|
+
import RemoteThree from '@/core/remote/RemoteThree';
|
3
|
+
type InspectRendererProps = {
|
4
|
+
three: RemoteThree;
|
5
|
+
};
|
6
|
+
type InspectRendererState = {
|
7
|
+
expanded: boolean;
|
8
|
+
lastUpdated: number;
|
9
|
+
};
|
10
|
+
export default class InspectRenderer extends Component<InspectRendererProps, InspectRendererState> {
|
11
|
+
private autoClear;
|
12
|
+
private autoClearColor;
|
13
|
+
private autoClearDepth;
|
14
|
+
private autoClearStencil;
|
15
|
+
private outputColorSpace;
|
16
|
+
private localClippingEnabled;
|
17
|
+
private clearColor;
|
18
|
+
private clearAlpha;
|
19
|
+
private toneMapping;
|
20
|
+
private toneMappingExposure;
|
21
|
+
constructor(props: InspectRendererProps);
|
22
|
+
componentwillunmount(): void;
|
23
|
+
private onAddRenderer;
|
24
|
+
render(): ReactNode;
|
25
|
+
private saveExpanded;
|
26
|
+
get expandedName(): string;
|
27
|
+
}
|
28
|
+
export {};
|