@tomorrowevening/hermes 0.0.113 → 0.0.114

Sign up to get free protection for your applications and to get access to all the features.
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.113",
10
+ "version": "0.0.114",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -1,39 +1,41 @@
1
- import { Camera, Curve, RenderTargetOptions, Scene, WebGLRenderTarget, WebGLRenderer } from 'three';
2
- import Application from '../Application';
3
- import BaseRemote from './BaseRemote';
4
- import { BroadcastData, GroupData } from '../types';
5
- export default class RemoteThree extends BaseRemote {
6
- scene?: Scene;
7
- scenes: Map<string, Scene>;
8
- renderer?: WebGLRenderer;
9
- renderTargets: Map<string, WebGLRenderTarget>;
10
- private groups;
11
- dispose(): void;
12
- getObject(uuid: string): void;
13
- setObject(value: any): void;
14
- requestMethod(uuid: string, key: string, value?: any, subitem?: string): void;
15
- updateObject(uuid: string, key: string, value: any): void;
16
- createTexture(uuid: string, key: string, value: any): void;
17
- addGroup(data: GroupData): void;
18
- removeGroup(name: string): void;
19
- updateGroup(group: string, prop: string, value: any): void;
20
- removeAllGroups(): void;
21
- addSpline(spline: Curve<any>): void;
22
- addScene(value: Scene): void;
23
- refreshScene(value: string): void;
24
- removeScene(value: Scene): void;
25
- removeAllScenes(): void;
26
- getScene(uuid: string): Scene | null;
27
- setScene(value: Scene): void;
28
- addCamera(camera: Camera): void;
29
- removeCamera(camera: Camera): void;
30
- handleApp(app: Application, remote: BaseRemote, msg: BroadcastData): void;
31
- handleEditor(app: Application, remote: BaseRemote, msg: BroadcastData): void;
32
- addRT(name: string, params?: RenderTargetOptions): void;
33
- resize(width: number, height: number): void;
34
- set dpr(value: number);
35
- get dpr(): number;
36
- get width(): number;
37
- get height(): number;
38
- get canvas(): HTMLCanvasElement | null;
39
- }
1
+ import { Camera, Curve, RenderTargetOptions, Scene, WebGLRenderTarget, WebGLRenderer } from 'three';
2
+ import Application from '../Application';
3
+ import BaseRemote from './BaseRemote';
4
+ import { BroadcastData, GroupData } from '../types';
5
+ export default class RemoteThree extends BaseRemote {
6
+ scene?: Scene;
7
+ scenes: Map<string, Scene>;
8
+ renderer?: WebGLRenderer;
9
+ renderTargets: Map<string, WebGLRenderTarget>;
10
+ private groups;
11
+ dispose(): void;
12
+ getObject(uuid: string): void;
13
+ setObject(value: any): void;
14
+ requestMethod(uuid: string, key: string, value?: any, subitem?: string): void;
15
+ updateObject(uuid: string, key: string, value: any): void;
16
+ createTexture(uuid: string, key: string, value: any): void;
17
+ addGroup(data: GroupData): void;
18
+ removeGroup(name: string): void;
19
+ updateGroup(group: string, prop: string, value: any): void;
20
+ removeAllGroups(): void;
21
+ addSpline(spline: Curve<any>): void;
22
+ addRenderer(value: WebGLRenderer): void;
23
+ updateRenderer(data: any): void;
24
+ addScene(value: Scene): void;
25
+ refreshScene(value: string): void;
26
+ removeScene(value: Scene): void;
27
+ removeAllScenes(): void;
28
+ getScene(uuid: string): Scene | null;
29
+ setScene(value: Scene): void;
30
+ addCamera(camera: Camera): void;
31
+ removeCamera(camera: Camera): void;
32
+ handleApp(app: Application, remote: BaseRemote, msg: BroadcastData): void;
33
+ handleEditor(app: Application, remote: BaseRemote, msg: BroadcastData): void;
34
+ addRT(name: string, params?: RenderTargetOptions): void;
35
+ resize(width: number, height: number): void;
36
+ set dpr(value: number);
37
+ get dpr(): number;
38
+ get width(): number;
39
+ get height(): number;
40
+ get canvas(): HTMLCanvasElement | null;
41
+ }
@@ -1,35 +1,35 @@
1
- import { InspectorFieldType } from '@/editor/sidePanel/inspector/InspectorField';
2
- export interface BroadcastData {
3
- target: ApplicationMode;
4
- event: EditorEvent;
5
- data?: any;
6
- }
7
- export interface GroupItemData {
8
- type: InspectorFieldType;
9
- prop: string;
10
- title?: string;
11
- value?: any;
12
- min?: number;
13
- max?: number;
14
- step?: number;
15
- disabled?: boolean;
16
- options?: any[];
17
- }
18
- export interface GroupData {
19
- title: string;
20
- items: GroupItemData[];
21
- onUpdate: (prop: string, value: any) => void;
22
- }
23
- export interface GroupCallback {
24
- title: string;
25
- onUpdate: (prop: string, value: any) => void;
26
- }
27
- export type ApplicationMode = 'app' | 'editor';
28
- export type VoidCallback = () => void;
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';
31
- export type VoidFunc = () => void;
32
- export type BroadcastCallback = (data: BroadcastData) => void;
33
- export type TheatreUpdateCallback = (data: any) => void;
34
- export declare const noop: () => void;
35
- export declare const defaultTheatreCallback: TheatreUpdateCallback;
1
+ import { InspectorFieldType } from '@/editor/sidePanel/inspector/InspectorField';
2
+ export interface BroadcastData {
3
+ target: ApplicationMode;
4
+ event: EditorEvent;
5
+ data?: any;
6
+ }
7
+ export interface GroupItemData {
8
+ type: InspectorFieldType;
9
+ prop: string;
10
+ title?: string;
11
+ value?: any;
12
+ min?: number;
13
+ max?: number;
14
+ step?: number;
15
+ disabled?: boolean;
16
+ options?: any[];
17
+ }
18
+ export interface GroupData {
19
+ title: string;
20
+ items: GroupItemData[];
21
+ onUpdate: (prop: string, value: any) => void;
22
+ }
23
+ export interface GroupCallback {
24
+ title: string;
25
+ onUpdate: (prop: string, value: any) => void;
26
+ }
27
+ export type ApplicationMode = 'app' | 'editor';
28
+ export type VoidCallback = () => void;
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' | 'addRenderer' | 'updateRenderer' | 'addFolder' | 'bindObject' | 'updateBind' | 'addButton' | 'clickButton' | 'selectComponent' | 'draggableListUpdate' | 'addGroup' | 'removeGroup' | 'updateGroup';
31
+ export type VoidFunc = () => void;
32
+ export type BroadcastCallback = (data: BroadcastData) => void;
33
+ export type TheatreUpdateCallback = (data: any) => void;
34
+ export declare const noop: () => void;
35
+ export declare const defaultTheatreCallback: TheatreUpdateCallback;
@@ -1,26 +1,28 @@
1
- import { EventDispatcher } from 'three';
2
- export declare enum ToolEvents {
3
- CUSTOM = "ToolEvents::custom",
4
- SELECT_DROPDOWN = "ToolEvents::selectDropdown",
5
- DRAG_UPDATE = "ToolEvents::dragUpdate",
6
- ADD_SCENE = "ToolEvents::addScene",
7
- REFRESH_SCENE = "ToolEvents::refreshScene",
8
- REMOVE_SCENE = "ToolEvents::removeScene",
9
- SET_SCENE = "ToolEvents::setScene",
10
- GET_OBJECT = "ToolEvents::getObject",
11
- SET_OBJECT = "ToolEvents::setObject",
12
- UPDATE_OBJECT = "ToolEvents::updateObject",
13
- CREATE_TEXTURE = "ToolEvents::createTexture",
14
- REQUEST_METHOD = "ToolEvents::requestMethod",
15
- ADD_CAMERA = "ToolEvents::addCamera",
16
- REMOVE_CAMERA = "ToolEvents::removeCamera",
17
- ADD_GROUP = "ToolEvents::addGroup",
18
- REMOVE_GROUP = "ToolEvents::removeGroup",
19
- ADD_SPLINE = "ToolEvents::addSpline"
20
- }
21
- export type ToolEvent = {
22
- [key in ToolEvents]: {
23
- value?: unknown;
24
- };
25
- };
26
- export declare const debugDispatcher: EventDispatcher<ToolEvent>;
1
+ import { EventDispatcher } from 'three';
2
+ export declare enum ToolEvents {
3
+ CUSTOM = "ToolEvents::custom",
4
+ SELECT_DROPDOWN = "ToolEvents::selectDropdown",
5
+ DRAG_UPDATE = "ToolEvents::dragUpdate",
6
+ ADD_SCENE = "ToolEvents::addScene",
7
+ REFRESH_SCENE = "ToolEvents::refreshScene",
8
+ REMOVE_SCENE = "ToolEvents::removeScene",
9
+ SET_SCENE = "ToolEvents::setScene",
10
+ GET_OBJECT = "ToolEvents::getObject",
11
+ SET_OBJECT = "ToolEvents::setObject",
12
+ UPDATE_OBJECT = "ToolEvents::updateObject",
13
+ CREATE_TEXTURE = "ToolEvents::createTexture",
14
+ REQUEST_METHOD = "ToolEvents::requestMethod",
15
+ ADD_CAMERA = "ToolEvents::addCamera",
16
+ REMOVE_CAMERA = "ToolEvents::removeCamera",
17
+ ADD_GROUP = "ToolEvents::addGroup",
18
+ REMOVE_GROUP = "ToolEvents::removeGroup",
19
+ ADD_SPLINE = "ToolEvents::addSpline",
20
+ ADD_RENDERER = "ToolEvents::addRenderer",
21
+ UPDATE_RENDERER = "ToolEvents::updateRenderer"
22
+ }
23
+ export type ToolEvent = {
24
+ [key in ToolEvents]: {
25
+ value?: unknown;
26
+ };
27
+ };
28
+ export declare const debugDispatcher: EventDispatcher<ToolEvent>;
@@ -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 {};