@tomorrowevening/hermes 0.0.115 → 0.0.116

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.115",
10
+ "version": "0.0.116",
11
11
  "homepage": "https://github.com/tomorrowevening/hermes#readme",
12
12
  "bugs": {
13
13
  "url": "https://github.com/tomorrowevening/hermes/issues"
@@ -60,6 +60,7 @@
60
60
  "@typescript-eslint/parser": "^6.4.0",
61
61
  "@vitejs/plugin-react": "^4.0.3",
62
62
  "camera-controls": "^2.9.0",
63
+ "detect-gpu": "^5.0.57",
63
64
  "eslint": "^8.45.0",
64
65
  "eslint-plugin-react": "^7.33.2",
65
66
  "eslint-plugin-react-hooks": "^4.6.0",
@@ -1,41 +1,42 @@
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
+ 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
+ canvas: HTMLCanvasElement | null;
7
+ inputElement: any;
8
+ scene?: Scene;
9
+ scenes: Map<string, Scene>;
10
+ renderer?: WebGLRenderer;
11
+ renderTargets: Map<string, WebGLRenderTarget>;
12
+ private groups;
13
+ dispose(): void;
14
+ getObject(uuid: string): void;
15
+ setObject(value: any): void;
16
+ requestMethod(uuid: string, key: string, value?: any, subitem?: string): void;
17
+ updateObject(uuid: string, key: string, value: any): void;
18
+ createTexture(uuid: string, key: string, value: any): void;
19
+ addGroup(data: GroupData): void;
20
+ removeGroup(name: string): void;
21
+ updateGroup(group: string, prop: string, value: any): void;
22
+ removeAllGroups(): void;
23
+ addSpline(spline: Curve<any>): void;
24
+ setRenderer(value: WebGLRenderer, inputElement?: any): void;
25
+ updateRenderer(data: any): void;
26
+ addScene(value: Scene): void;
27
+ refreshScene(value: string): void;
28
+ removeScene(value: Scene): void;
29
+ removeAllScenes(): void;
30
+ getScene(uuid: string): Scene | null;
31
+ setScene(value: Scene): void;
32
+ addCamera(camera: Camera): void;
33
+ removeCamera(camera: Camera): void;
34
+ handleApp(app: Application, remote: BaseRemote, msg: BroadcastData): void;
35
+ handleEditor(app: Application, remote: BaseRemote, msg: BroadcastData): void;
36
+ addRT(name: string, params?: RenderTargetOptions): void;
37
+ resize(width: number, height: number): void;
38
+ set dpr(value: number);
39
+ get dpr(): number;
40
+ get width(): number;
41
+ get height(): number;
42
+ }
@@ -1,31 +1,5 @@
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
+ export declare function capitalize(value: string): string;
2
+ export declare function copyToClipboard(data: any): string;
3
+ export declare function randomID(): string;
4
+ export declare function isColor(obj: any): boolean;
5
+ export declare function colorToHex(obj: any): string;
package/types/index.d.ts CHANGED
@@ -1,27 +1,29 @@
1
- export * from './core/types';
2
- export * from './editor/utils';
3
- export { default as Application } from './core/Application';
4
- export { debugDispatcher, ToolEvents } from './editor/global';
5
- export { default as BaseRemote } from './core/remote/BaseRemote';
6
- export { default as RemoteComponents } from './core/remote/RemoteComponents';
7
- export * from './editor/theatreUtils';
8
- export { default as RemoteTheatre } from './core/remote/RemoteTheatre';
9
- export { default as RemoteThree } from './core/remote/RemoteThree';
10
- export { default as NavButton } from './editor/components/NavButton';
11
- export { default as DraggableItem } from './editor/components/DraggableItem';
12
- export { default as Draggable } from './editor/components/Draggable';
13
- export { default as DropdownItem } from './editor/components/DropdownItem';
14
- export { default as Dropdown } from './editor/components/Dropdown';
15
- export { default as RemoteController } from './core/RemoteController';
16
- export { default as SidePanel } from './editor/sidePanel/SidePanel';
17
- export { default as Accordion } from './editor/sidePanel/Accordion';
18
- export { default as ChildObject } from './editor/sidePanel/ChildObject';
19
- export { default as ContainerObject } from './editor/sidePanel/ContainerObject';
20
- export { default as Inspector } from './editor/sidePanel/inspector/Inspector';
21
- export { default as SceneInspector } from './editor/sidePanel/inspector/SceneInspector';
22
- export { default as MultiView } from './editor/multiView/MultiView';
23
- export { default as Editor } from './editor/Editor';
24
- export { default as ThreeEditor } from './editor/ThreeEditor';
25
- export { default as Transform } from './editor/tools/Transform';
26
- export { default as Spline } from './editor/tools/splineEditor/Spline';
27
- export { default as SplineEditor } from './editor/tools/splineEditor/index';
1
+ export * from './core/types';
2
+ export * from './editor/utils';
3
+ export * from './utils/three';
4
+ export * from './utils/detectSettings';
5
+ export { default as Application } from './core/Application';
6
+ export { debugDispatcher, ToolEvents } from './editor/global';
7
+ export { default as BaseRemote } from './core/remote/BaseRemote';
8
+ export { default as RemoteComponents } from './core/remote/RemoteComponents';
9
+ export * from './editor/theatreUtils';
10
+ export { default as RemoteTheatre } from './core/remote/RemoteTheatre';
11
+ export { default as RemoteThree } from './core/remote/RemoteThree';
12
+ export { default as NavButton } from './editor/components/NavButton';
13
+ export { default as DraggableItem } from './editor/components/DraggableItem';
14
+ export { default as Draggable } from './editor/components/Draggable';
15
+ export { default as DropdownItem } from './editor/components/DropdownItem';
16
+ export { default as Dropdown } from './editor/components/Dropdown';
17
+ export { default as RemoteController } from './core/RemoteController';
18
+ export { default as SidePanel } from './editor/sidePanel/SidePanel';
19
+ export { default as Accordion } from './editor/sidePanel/Accordion';
20
+ export { default as ChildObject } from './editor/sidePanel/ChildObject';
21
+ export { default as ContainerObject } from './editor/sidePanel/ContainerObject';
22
+ export { default as Inspector } from './editor/sidePanel/inspector/Inspector';
23
+ export { default as SceneInspector } from './editor/sidePanel/inspector/SceneInspector';
24
+ export { default as MultiView } from './editor/multiView/MultiView';
25
+ export { default as Editor } from './editor/Editor';
26
+ export { default as ThreeEditor } from './editor/ThreeEditor';
27
+ export { default as Transform } from './editor/tools/Transform';
28
+ export { default as Spline } from './editor/tools/splineEditor/Spline';
29
+ export { default as SplineEditor } from './editor/tools/splineEditor/index';
@@ -0,0 +1,15 @@
1
+ export declare enum QualityType {
2
+ 'High' = 0,
3
+ 'Medium' = 1,
4
+ 'Low' = 2
5
+ }
6
+ export type AppSettings = {
7
+ dpr: number;
8
+ fps: number;
9
+ width: number;
10
+ height: number;
11
+ mobile: boolean;
12
+ supportOffScreenCanvas: boolean;
13
+ quality: QualityType;
14
+ };
15
+ export declare function detectSettings(canvas: HTMLCanvasElement): Promise<AppSettings>;
@@ -0,0 +1,5 @@
1
+ export declare function clamp(min: number, max: number, value: number): number;
2
+ export declare function normalize(min: number, max: number, value: number): number;
3
+ export declare function mix(min: number, max: number, value: number): number;
4
+ export declare function distance(x: number, y: number): number;
5
+ export declare function round(value: number, precision?: number): number;
@@ -0,0 +1,21 @@
1
+ import { Material, Object3D, Texture, WebGLRenderer } from 'three';
2
+ export declare const disposeTexture: (texture?: Texture) => void;
3
+ export declare const disposeMaterial: (material?: Material | Material[]) => void;
4
+ export declare const dispose: (object: Object3D) => void;
5
+ export declare let totalThreeObjects: number;
6
+ export declare const resetThreeObjects: () => void;
7
+ export declare const hierarchyUUID: (object: Object3D) => void;
8
+ export declare class ExportTexture {
9
+ static renderer: WebGLRenderer;
10
+ private static canvas;
11
+ private static context;
12
+ private static scene;
13
+ private static camera;
14
+ private static material;
15
+ private static inited;
16
+ private static width;
17
+ private static height;
18
+ private static init;
19
+ static renderToBlob(texture: Texture): string;
20
+ private static renderToCanvas;
21
+ }