soonspacejs 2.14.2 → 2.14.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soonspacejs",
3
- "version": "2.14.2",
3
+ "version": "2.14.3",
4
4
  "homepage": "https://www.xwbuilders.com/soonspacejs/",
5
5
  "description": "soonspacejs 2.x",
6
6
  "module": "./dist/index.esm.js",
@@ -32,5 +32,5 @@
32
32
  "three": ">=0.172.0 <0.180.0",
33
33
  "three-mesh-bvh": ">=0.9.1"
34
34
  },
35
- "gitHead": "00bbf1c9241f4466abe494c009c99a316ccfc24a"
35
+ "gitHead": "fd0fa9cd584123a5e8bc9565940ccb68b034cd70"
36
36
  }
@@ -1,4 +1,4 @@
1
- import { Object3D } from 'three';
1
+ import { Object3D, Texture } from 'three';
2
2
  import { Tween } from 'three/examples/jsm/libs/tween.module.js';
3
3
  import { IColor, Position, BaseSelectOptions } from './base';
4
4
  import { GridHelperOptions } from './manager';
@@ -205,4 +205,26 @@ export interface ToneMappingOptions {
205
205
  type?: 'None' | 'Reinhard' | 'Cineon' | 'ACESFilmic' | 'AGX' | 'Neutral';
206
206
  exposure?: number;
207
207
  }
208
+ export interface MaterialEffectOptions {
209
+ edge: EdgeSelectOptions;
210
+ stroke: StrokeSelectOptions;
211
+ opacity: OpacitySelectOptions;
212
+ highlight: HighlightSelectOptions;
213
+ emissive: {
214
+ emissive: EmissiveSelectOptions;
215
+ };
216
+ }
217
+ export type MaterialEffectType = 'material' | 'geometry' | 'effect';
218
+ export interface MaterialEffectOptionItem {
219
+ type: keyof MaterialEffectOptions;
220
+ option: MaterialEffectOptions[keyof MaterialEffectOptions] | null;
221
+ }
222
+ export type MaterialEffectOptionList = MaterialEffectOptionItem[];
223
+ export interface UpdateMaterialOption {
224
+ color?: IColor;
225
+ opacity?: number;
226
+ depthWrite?: boolean;
227
+ map?: Texture | null;
228
+ emissive?: EmissiveSelectOptions | null;
229
+ }
208
230
  export { CameraViewpointData, CameraViewpointDataLegacy, FlyToOptions, FlyToObjOptions, SurroundOptions, LabelOptions, InternalOptions, SelectModelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SkyOptions, ViewportOptions, ViewportState, IntersectsOptions, };
@@ -1,6 +1,6 @@
1
- import { Scene, Mesh, Object3D } from 'three';
1
+ import { Scene, Mesh, Material, Object3D } from 'three';
2
2
  import { default as localforage } from 'localforage';
3
- import { EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SignalsState, ViewportState } from '../Interface';
3
+ import { EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, SignalsState, ViewportState, UpdateMaterialOption } from '../Interface';
4
4
  declare class Scener {
5
5
  readonly signals: SignalsState;
6
6
  readonly viewportState: ViewportState;
@@ -32,12 +32,18 @@ declare class Scener {
32
32
  unEdgeShow(objects?: Object3D | Object3D[]): Promise<void | void[]>;
33
33
  strokeShow(object: Object3D | Object3D[], options?: StrokeSelectOptions): Promise<void | void[]>;
34
34
  unStrokeShow(objects?: Object3D | Object3D[]): Promise<void | void[]>;
35
- opacityShow(object: Object3D | Object3D[], options?: OpacitySelectOptions): Promise<void | void[]>;
35
+ opacityShow(object: Object3D | Object3D[], option?: OpacitySelectOptions): Promise<void | void[]>;
36
36
  unOpacityShow(objects?: Object3D | Object3D[]): Promise<void | void[]>;
37
37
  highlightShow(object: Object3D | Object3D[], options?: HighlightSelectOptions): Promise<void | void[]>;
38
38
  unHighlightShow(objects?: Object3D | Object3D[]): Promise<void | void[]>;
39
39
  emissiveShow(object: Object3D | Object3D[], options?: EmissiveSelectOptions): Promise<void | void[]>;
40
40
  unEmissiveShow(objects?: Object3D | Object3D[]): Promise<void | void[]>;
41
+ updateMaterial(material: Material, materialOption: UpdateMaterialOption): Material;
42
+ private _handleEmissiveShow;
43
+ private _handleUnEmissive;
41
44
  _triggerObjectAdded(object: Object3D): void;
45
+ private _setSelectItemMaterial;
46
+ private _updateMaterialEffectStack;
47
+ private _runObjectMaterialEffectStack;
42
48
  }
43
49
  export default Scener;