@tomorrowevening/hermes 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/hermes.cjs.js +15 -15
  2. package/dist/hermes.esm.js +809 -811
  3. package/package.json +1 -5
  4. package/types/core/Application.d.ts +5 -4
  5. package/types/core/remote/BaseRemote.d.ts +4 -0
  6. package/types/core/remote/RemoteComponents.d.ts +1 -2
  7. package/types/core/remote/RemoteTheatre.d.ts +3 -4
  8. package/types/core/remote/RemoteThree.d.ts +2 -3
  9. package/types/core/remote/RemoteTweakpane.d.ts +1 -1
  10. package/types/editor/sidePanel/SidePanel.d.ts +1 -9
  11. package/dist/hermes.umd.js +0 -144
  12. package/src/core/Application.ts +0 -111
  13. package/src/core/RemoteController.ts +0 -60
  14. package/src/core/remote/BaseRemote.ts +0 -16
  15. package/src/core/remote/RemoteComponents.ts +0 -45
  16. package/src/core/remote/RemoteTheatre.ts +0 -300
  17. package/src/core/remote/RemoteThree.ts +0 -143
  18. package/src/core/remote/RemoteTweakpane.ts +0 -194
  19. package/src/core/types.ts +0 -56
  20. package/src/editor/Editor.tsx +0 -20
  21. package/src/editor/components/Draggable.tsx +0 -40
  22. package/src/editor/components/DraggableItem.tsx +0 -22
  23. package/src/editor/components/Dropdown.tsx +0 -38
  24. package/src/editor/components/DropdownItem.tsx +0 -64
  25. package/src/editor/components/NavButton.tsx +0 -11
  26. package/src/editor/components/content.ts +0 -2
  27. package/src/editor/components/icons/CloseIcon.tsx +0 -7
  28. package/src/editor/components/icons/DragIcon.tsx +0 -9
  29. package/src/editor/components/types.ts +0 -41
  30. package/src/editor/global.ts +0 -20
  31. package/src/editor/multiView/CameraWindow.tsx +0 -74
  32. package/src/editor/multiView/InfiniteGridHelper.ts +0 -24
  33. package/src/editor/multiView/InfiniteGridMaterial.ts +0 -127
  34. package/src/editor/multiView/MultiView.scss +0 -101
  35. package/src/editor/multiView/MultiView.tsx +0 -636
  36. package/src/editor/multiView/MultiViewData.ts +0 -59
  37. package/src/editor/multiView/UVMaterial.ts +0 -55
  38. package/src/editor/scss/_debug.scss +0 -58
  39. package/src/editor/scss/_draggable.scss +0 -43
  40. package/src/editor/scss/_dropdown.scss +0 -84
  41. package/src/editor/scss/_sidePanel.scss +0 -278
  42. package/src/editor/scss/_theme.scss +0 -9
  43. package/src/editor/scss/index.scss +0 -67
  44. package/src/editor/sidePanel/Accordion.tsx +0 -41
  45. package/src/editor/sidePanel/ChildObject.tsx +0 -57
  46. package/src/editor/sidePanel/ContainerObject.tsx +0 -11
  47. package/src/editor/sidePanel/SidePanel.tsx +0 -64
  48. package/src/editor/sidePanel/ToggleBtn.tsx +0 -27
  49. package/src/editor/sidePanel/inspector/Inspector.tsx +0 -119
  50. package/src/editor/sidePanel/inspector/InspectorField.tsx +0 -198
  51. package/src/editor/sidePanel/inspector/InspectorGroup.tsx +0 -50
  52. package/src/editor/sidePanel/inspector/SceneInspector.tsx +0 -84
  53. package/src/editor/sidePanel/inspector/inspector.scss +0 -161
  54. package/src/editor/sidePanel/inspector/utils/InspectAnimation.tsx +0 -102
  55. package/src/editor/sidePanel/inspector/utils/InspectCamera.tsx +0 -75
  56. package/src/editor/sidePanel/inspector/utils/InspectLight.tsx +0 -62
  57. package/src/editor/sidePanel/inspector/utils/InspectMaterial.tsx +0 -710
  58. package/src/editor/sidePanel/inspector/utils/InspectTransform.tsx +0 -113
  59. package/src/editor/sidePanel/types.ts +0 -130
  60. package/src/editor/sidePanel/utils.ts +0 -278
  61. package/src/editor/utils.ts +0 -117
  62. package/src/example/CustomEditor.tsx +0 -78
  63. package/src/example/components/App.css +0 -6
  64. package/src/example/components/App.tsx +0 -246
  65. package/src/example/constants.ts +0 -52
  66. package/src/example/index.scss +0 -45
  67. package/src/example/main.tsx +0 -37
  68. package/src/example/three/BaseScene.ts +0 -42
  69. package/src/example/three/CustomMaterial.ts +0 -72
  70. package/src/example/three/FBXAnimation.ts +0 -26
  71. package/src/example/three/Scene1.ts +0 -225
  72. package/src/example/three/Scene2.ts +0 -138
  73. package/src/example/three/loader.ts +0 -110
  74. package/src/index.ts +0 -27
  75. package/src/vite-env.d.ts +0 -1
@@ -1,127 +0,0 @@
1
- import { Color, DoubleSide, GLSL3, ShaderMaterial } from 'three';
2
-
3
- type InfiniteGridProps = {
4
- divisions?: number
5
- scale?: number
6
- color?: Color
7
- distance?: number
8
- subgridOpacity?: number
9
- gridOpacity?: number
10
- }
11
-
12
- const vertex = `out vec3 worldPosition;
13
- uniform float uDistance;
14
-
15
- void main() {
16
- // Scale the plane by the drawing distance
17
- worldPosition = position.xzy * uDistance;
18
- worldPosition.xz += cameraPosition.xz;
19
-
20
- gl_Position = projectionMatrix * modelViewMatrix * vec4(worldPosition, 1.0);
21
- }`;
22
-
23
- const fragment = `out vec4 fragColor;
24
- in vec3 worldPosition;
25
-
26
- uniform float uDivisions;
27
- uniform float uScale;
28
- uniform vec3 uColor;
29
- uniform float uDistance;
30
- uniform float uSubgridOpacity;
31
- uniform float uGridOpacity;
32
-
33
- float getGrid(float gapSize) {
34
- vec2 worldPositionByDivision = worldPosition.xz / gapSize;
35
-
36
- // Inverted, 0 where line, >1 where there's no line
37
- // We use the worldPosition (which in this case we use similarly to UVs) differential to control the anti-aliasing
38
- // We need to do the -0.5)-0.5 trick because the result fades out from 0 to 1, and we want both
39
- // worldPositionByDivision == 0.3 and worldPositionByDivision == 0.7 to result in the same fade, i.e. 0.3,
40
- // otherwise only one side of the line will be anti-aliased
41
- vec2 grid = abs(fract(worldPositionByDivision-0.5)-0.5) / fwidth(worldPositionByDivision) / 2.0;
42
- float gridLine = min(grid.x, grid.y);
43
-
44
- // Uninvert and clamp
45
- return 1.0 - min(gridLine, 1.0);
46
- }
47
-
48
- void main() {
49
- float cameraDistanceToGridPlane = distance(cameraPosition.y, worldPosition.y);
50
- float cameraDistanceToFragmentOnGridPlane = distance(cameraPosition.xz, worldPosition.xz);
51
-
52
- // The size of the grid and subgrid are powers of each other and they are determined based on camera distance.
53
- // The current grid will become the next subgrid when it becomes too small, and its next power becomes the new grid.
54
- float subGridPower = pow(uDivisions, floor(log(cameraDistanceToGridPlane) / log(uDivisions)));
55
- float gridPower = subGridPower * uDivisions;
56
-
57
- // If we want to fade both the grid and its subgrid, we need to displays 3 different opacities, with the next grid being the third
58
- float nextGridPower = gridPower * uDivisions;
59
-
60
- // 1 where grid, 0 where no grid
61
- float subgrid = getGrid(subGridPower * uScale);
62
- float grid = getGrid(gridPower * uScale);
63
- float nextGrid = getGrid(nextGridPower * uScale);
64
-
65
- // Where we are between the introduction of the current grid power and when we switch to the next grid power
66
- float stepPercentage = (cameraDistanceToGridPlane - subGridPower)/(gridPower - subGridPower);
67
-
68
- // The last x percentage of the current step over which we want to fade
69
- float fadeRange = 0.3;
70
-
71
- // We calculate the fade percentage from the step percentage and the fade range
72
- float fadePercentage = max(stepPercentage - 1.0 + fadeRange, 0.0) / fadeRange;
73
-
74
- // Set base opacity based on how close we are to the drawing distance, with a cubic falloff
75
- float baseOpacity = subgrid * pow(1.0 - min(cameraDistanceToFragmentOnGridPlane / uDistance, 1.0), 3.0);
76
-
77
- // Shade the subgrid
78
- fragColor = vec4(uColor.rgb, (baseOpacity - fadePercentage) * uSubgridOpacity);
79
-
80
- // Somewhat arbitrary additional fade coefficient to counter anti-aliasing popping when switching between grid powers
81
- float fadeCoefficient = 0.5;
82
-
83
- // Shade the grid
84
- fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity - fadePercentage * (uGridOpacity - uSubgridOpacity) * fadeCoefficient, grid);
85
-
86
- // Shade the next grid
87
- fragColor.a = mix(fragColor.a, baseOpacity * uGridOpacity, nextGrid);
88
-
89
- if (fragColor.a <= 0.0) discard;
90
- }`;
91
-
92
- export default class InfiniteGridMaterial extends ShaderMaterial {
93
- constructor(props?: InfiniteGridProps) {
94
- super({
95
- extensions: {
96
- derivatives: true,
97
- },
98
- glslVersion: GLSL3,
99
- side: DoubleSide,
100
- transparent: true,
101
- uniforms: {
102
- uScale: {
103
- value: props?.scale !== undefined ? props?.scale : 0.1,
104
- },
105
- uDivisions: {
106
- value: props?.divisions !== undefined ? props?.divisions : 10,
107
- },
108
- uColor: {
109
- value: props?.color !== undefined ? props?.color : new Color(0xffffff),
110
- },
111
- uDistance: {
112
- value: props?.distance !== undefined ? props?.distance : 10000,
113
- },
114
- uSubgridOpacity: {
115
- value: props?.subgridOpacity !== undefined ? props?.subgridOpacity : 0.15,
116
- },
117
- uGridOpacity: {
118
- value: props?.gridOpacity !== undefined ? props?.gridOpacity : 0.25,
119
- },
120
- },
121
- vertexShader: vertex,
122
- fragmentShader: fragment,
123
- name: 'InfiniteGrid',
124
- depthWrite: false,
125
- });
126
- }
127
- }
@@ -1,101 +0,0 @@
1
- $padding: 2px;
2
-
3
- .multiview {
4
- display: grid;
5
- font-family: Roboto Mono, Source Code Pro, Menlo, Courier, monospace;
6
- font-size: 10px;
7
- grid-template-columns: repeat(2, 1fr);
8
- position: absolute;
9
- overflow: hidden;
10
- left: 0;
11
- top: 0;
12
- right: 300px;
13
- bottom: 0;
14
- z-index: 1;
15
-
16
- canvas {
17
- pointer-events: none;
18
- }
19
-
20
- .dropdown {
21
- background-color: #222;
22
- display: inline-block;
23
- font-size: 10px;
24
- padding: $padding;
25
- text-align: center;
26
- width: 100px;
27
-
28
- .dropdown-toggle {
29
- cursor: pointer;
30
- }
31
-
32
- .dropdown-menu {
33
- position: absolute;
34
- top: 100%;
35
- left: 0;
36
- z-index: 1;
37
- list-style: none;
38
- padding: 0;
39
- margin: 0;
40
- width: 100%;
41
-
42
- li {
43
- background-color: #222;
44
- cursor: pointer;
45
- padding: $padding;
46
- transition: 0.2s linear background-color;
47
- &:hover {
48
- background-color: #333;
49
- }
50
- }
51
- }
52
- }
53
-
54
- .cameras {
55
- display: grid;
56
- grid-template-columns: repeat(2, 1fr);
57
- pointer-events: visible;
58
- position: absolute;
59
- width: 100%;
60
- height: 100%;
61
-
62
- &.single {
63
- grid-template-columns: repeat(1, 1fr);
64
- }
65
-
66
- .dropdown {
67
- position: absolute;
68
- top: 0;
69
- left: 50%;
70
- transform: translateX(-50%);
71
-
72
- &.up {
73
- bottom: 0;
74
- top: initial;
75
- .dropdown-menu {
76
- top: initial;
77
- bottom: 100%;
78
- }
79
- }
80
- }
81
-
82
- .CameraWindow {
83
- border: 1px dotted #333;
84
- pointer-events: visible;
85
- position: relative;
86
-
87
- .clickable {
88
- display: inline-block;
89
- width: 100%;
90
- height: 100%;
91
- }
92
- }
93
- }
94
-
95
- .settings {
96
- pointer-events: visible;
97
- position: absolute;
98
- left: 50%;
99
- transform: translateX(-50%);
100
- }
101
- }