@tomorrowevening/hermes 0.0.7 → 0.0.8

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.
@@ -1,4 +1,4 @@
1
- import { Camera, CubeTexture, Light, Material, Mesh, Object3D, OrthographicCamera, PerspectiveCamera, RepeatWrapping, Texture } from 'three';
1
+ import { CubeTexture, Material, Mesh, Object3D, RepeatWrapping, Texture } from 'three';
2
2
  import { MinimumObject, RemoteMaterial, RemoteObject } from './types';
3
3
 
4
4
  export function determineIcon(obj: Object3D): string {
@@ -132,9 +132,15 @@ export function stripObject(obj: Object3D): RemoteObject {
132
132
  uuid: obj.uuid,
133
133
  visible: obj.visible,
134
134
  matrix: obj.matrix.elements,
135
+ material: undefined,
136
+ perspectiveCameraInfo: undefined,
137
+ orthographicCameraInfo: undefined,
138
+ lightInfo: undefined,
135
139
  };
136
140
 
137
- if (obj instanceof Mesh) {
141
+ const type = obj.type.toLowerCase();
142
+
143
+ if (type.search('mesh') > -1) {
138
144
  const mesh = obj as Mesh;
139
145
  if (Array.isArray(mesh.material)) {
140
146
  const data: RemoteMaterial[] = [];
@@ -145,33 +151,33 @@ export function stripObject(obj: Object3D): RemoteObject {
145
151
  } else {
146
152
  stripped.material = stripMaterialData(mesh.material);
147
153
  }
148
- } else if (obj instanceof Camera) {
149
- if (obj instanceof PerspectiveCamera) {
154
+ } else if (type.search('camera') > -1) {
155
+ if (obj.type === 'PerspectiveCamera') {
150
156
  stripped.perspectiveCameraInfo = {
151
- fov: obj.fov,
152
- zoom: obj.zoom,
153
- near: obj.near,
154
- far: obj.far,
155
- focus: obj.focus,
156
- aspect: obj.aspect,
157
- filmGauge: obj.filmGauge,
158
- filmOffset: obj.filmOffset,
157
+ fov: obj['fov'],
158
+ zoom: obj['zoom'],
159
+ near: obj['near'],
160
+ far: obj['far'],
161
+ focus: obj['focus'],
162
+ aspect: obj['aspect'],
163
+ filmGauge: obj['filmGauge'],
164
+ filmOffset: obj['filmOffset'],
159
165
  };
160
- } else if (obj instanceof OrthographicCamera) {
166
+ } else if (obj.type === 'OrthographicCamera') {
161
167
  stripped.orthographicCameraInfo = {
162
- zoom: obj.zoom,
163
- near: obj.near,
164
- far: obj.far,
165
- left: obj.left,
166
- right: obj.right,
167
- top: obj.top,
168
- bottom: obj.bottom,
168
+ zoom: obj['zoom'],
169
+ near: obj['near'],
170
+ far: obj['far'],
171
+ left: obj['left'],
172
+ right: obj['right'],
173
+ top: obj['top'],
174
+ bottom: obj['bottom'],
169
175
  };
170
176
  }
171
- } else if (obj instanceof Light) {
177
+ } else if (type.search('light') > -1) {
172
178
  stripped.lightInfo = {
173
- color: obj.color,
174
- intensity: obj.intensity,
179
+ color: obj['color'],
180
+ intensity: obj['intensity'],
175
181
  decay: obj['decay'],
176
182
  distance: obj['distance'],
177
183
  angle: obj['angle'],
@@ -1,3 +1,3 @@
1
1
  import RemoteThree from '@/core/remote/RemoteThree';
2
- import { RemoteObject } from "../../types";
2
+ import { RemoteObject } from '../../types';
3
3
  export declare function InspectCamera(object: RemoteObject, three: RemoteThree): any;
@@ -1,3 +1,3 @@
1
- import { RemoteObject } from "../../types";
2
1
  import RemoteThree from '@/core/remote/RemoteThree';
2
+ import { RemoteObject } from '../../types';
3
3
  export declare function InspectLight(obj: RemoteObject, three: RemoteThree): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { RemoteMaterial, RemoteObject } from "../../types";
2
2
  import RemoteThree from '@/core/remote/RemoteThree';
3
3
  export declare function acceptedMaterialNames(name: string): boolean;
4
- export declare function niceMaterialNames(name: string): string;
4
+ export declare function prettyName(name: string): string;
5
5
  export declare function clampedNames(name: string): boolean;
6
6
  export declare function uploadLocalImage(): Promise<string>;
7
7
  export declare function inspectMaterialItems(material: RemoteMaterial, object: RemoteObject, three: RemoteThree): any[];