@tomorrowevening/hermes 0.0.99 → 0.0.101

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,24 @@
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,7 +1,23 @@
1
+ import { Component, ReactNode, RefObject } from 'react';
1
2
  import { InspectorFieldProps } from './InspectorField';
3
+ import { GroupData } from '@/core/types';
2
4
  export interface InspectorGroupProps {
3
5
  title: string;
4
6
  expanded?: boolean;
5
7
  items: InspectorFieldProps[] | InspectorGroupProps[];
8
+ onToggle?: (value: boolean) => void;
6
9
  }
7
- export default function InspectorGroup(props: InspectorGroupProps): import("react/jsx-runtime").JSX.Element;
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,3 +1,25 @@
1
+ import { Euler, Matrix4, Vector3 } from 'three';
2
+ import { Component, ReactNode } from 'react';
1
3
  import { RemoteObject } from '../../types';
2
4
  import RemoteThree from '@/core/remote/RemoteThree';
3
- export declare function InspectTransform(object: RemoteObject, three: RemoteThree): import("react/jsx-runtime").JSX.Element;
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 {};
@@ -0,0 +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
+ }
@@ -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: (defaultPoints?: 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,25 @@
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
+ createSpline: (defaultPoints?: Array<Vector3>) => Spline;
19
+ createSplineFromArray: (points: Array<number[]>) => Spline;
20
+ createSplineFromCurve: (curve: CatmullRomCurve3) => Spline;
21
+ createSplineFromJSON: (data: SplineJSON) => Spline;
22
+ showPoints: (visible?: boolean) => void;
23
+ get camera(): Camera;
24
+ set camera(value: Camera);
25
+ }
@@ -1,5 +1,6 @@
1
1
  import { Material, Object3D, Texture, WebGLRenderer } from 'three';
2
2
  export declare function capitalize(value: string): string;
3
+ export declare function copyToClipboard(data: any): string;
3
4
  export declare function clamp(min: number, max: number, value: number): number;
4
5
  export declare function normalize(min: number, max: number, value: number): number;
5
6
  export declare function mix(min: number, max: number, value: number): number;