soonspacejs 2.3.17 → 2.3.20
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/dist/index.esm.js +6 -6
- package/dist/index.js +6 -6
- package/package.json +4 -4
- package/types/Interface/base.d.ts +6 -0
- package/types/Interface/viewport.d.ts +1 -0
- package/types/Library/BaseMesh.d.ts +5 -4
- package/types/Library/BaseObject3D.d.ts +4 -4
- package/types/Library/Circle.d.ts +2 -0
- package/types/Library/Line.d.ts +2 -0
- package/types/Library/Model.d.ts +2 -2
- package/types/Library/Poi.d.ts +2 -2
- package/types/Library/Point.d.ts +2 -0
- package/types/Library/Polygon.d.ts +2 -0
- package/types/Library/Sbm.d.ts +2 -2
- package/types/Shared/map.d.ts +9 -1
- package/types/Viewport/CameraManager.d.ts +1 -1
- package/types/Viewport/ViewHelper.d.ts +7 -0
- package/types/Viewport/index.d.ts +6 -3
- package/types/index.d.ts +1 -0
- package/types/environments/RoomEnvironment.d.ts +0 -8
- package/types/environments/index.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.20",
|
|
4
4
|
"description": "soonspacejs 2.x",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
"@robotlegsjs/signals": "1.1.0",
|
|
18
18
|
"@soonspacejs/xml2json": "0.0.2",
|
|
19
19
|
"@tweenjs/tween.js": "18.6.4",
|
|
20
|
-
"@types/three": "
|
|
20
|
+
"@types/three": "0.139.0",
|
|
21
21
|
"localforage": "1.9.0",
|
|
22
|
-
"three": "
|
|
22
|
+
"three": "0.139.0"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "e1703d68f492f42e428f921e5436aa425346d20e"
|
|
25
25
|
}
|
|
@@ -38,4 +38,10 @@ interface ObjectEvents<ObjectType> {
|
|
|
38
38
|
onDblClick?: ((object: ObjectType) => void) | null;
|
|
39
39
|
onRightClick?: ((object: ObjectType) => void) | null;
|
|
40
40
|
}
|
|
41
|
+
export interface ObjectEventsListener {
|
|
42
|
+
type: 'click' | 'rightClick' | 'dblClick';
|
|
43
|
+
}
|
|
44
|
+
export interface Interpolate {
|
|
45
|
+
t: number;
|
|
46
|
+
}
|
|
41
47
|
export { IVector2, IVector3, Position, Rotation, Scale, IColor, PlaneIVector2, Level, OffsetPoint, FlyToViewpoint, AxisType, SceneEventType, PoiNodeType, BaseSelectOptions, ObjectEvents, };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Box3, Vector3, Euler, Mesh, BufferGeometry, Material } from 'three';
|
|
2
|
-
import {
|
|
2
|
+
import { Tween } from '@tweenjs/tween.js';
|
|
3
|
+
import { Position, Rotation, Scale, Level, AnimationOptions, Interpolate } from '../Interface';
|
|
3
4
|
import { BaseObject3DInfo } from './BaseObject3D';
|
|
4
5
|
declare type BaseMeshInfo = BaseObject3DInfo;
|
|
5
6
|
declare class BaseMesh extends Mesh {
|
|
@@ -12,9 +13,9 @@ declare class BaseMesh extends Mesh {
|
|
|
12
13
|
constructor(geometry: BufferGeometry, material: Material | Material[], param: BaseMeshInfo, type?: string);
|
|
13
14
|
show(): void;
|
|
14
15
|
hide(): void;
|
|
15
|
-
setMove(position: Position | Vector3, options?: AnimationOptions): Promise<void>;
|
|
16
|
-
setRotate(rotation: Rotation | Euler, options?: AnimationOptions): Promise<void>;
|
|
17
|
-
setScale(scale: Scale | Vector3, options?: AnimationOptions): Promise<void>;
|
|
16
|
+
setMove(position: Position | Vector3, options?: AnimationOptions, onUpdate?: (source: Position, tween: Tween<Position>) => void, onStart?: (tween: Tween<Position>) => void): Promise<void>;
|
|
17
|
+
setRotate(rotation: Rotation | Euler, options?: AnimationOptions, onUpdate?: (source: Rotation, tween: Tween<Interpolate>) => void, onStart?: (tween: Tween<Interpolate>) => void): Promise<void>;
|
|
18
|
+
setScale(scale: Scale | Vector3, options?: AnimationOptions, onUpdate?: (source: Scale, tween: Tween<Scale>) => void, onStart?: (tween: Tween<Scale>) => void): Promise<void>;
|
|
18
19
|
getBoundingBox(): Box3;
|
|
19
20
|
eventPropagation(): void;
|
|
20
21
|
sClone(recursive?: boolean): BaseMesh;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Object3D, Vector3, Euler } from 'three';
|
|
1
|
+
import { Object3D, Vector3, Euler, BaseEvent, Event } from 'three';
|
|
2
2
|
import { Tween } from '@tweenjs/tween.js';
|
|
3
|
-
import { Position, Rotation, Scale, Level, AnimationOptions } from '../Interface';
|
|
3
|
+
import { Position, Rotation, Scale, Level, AnimationOptions, Interpolate } from '../Interface';
|
|
4
4
|
interface BaseObject3DInfo {
|
|
5
5
|
id: string | number;
|
|
6
6
|
name?: string;
|
|
@@ -11,7 +11,7 @@ interface BaseObject3DInfo {
|
|
|
11
11
|
scale?: Scale;
|
|
12
12
|
userData?: any;
|
|
13
13
|
}
|
|
14
|
-
declare class BaseObject3D extends Object3D {
|
|
14
|
+
declare class BaseObject3D<E extends BaseEvent = Event> extends Object3D<E> {
|
|
15
15
|
sid: string | number;
|
|
16
16
|
stype: string;
|
|
17
17
|
handleHide: boolean;
|
|
@@ -21,7 +21,7 @@ declare class BaseObject3D extends Object3D {
|
|
|
21
21
|
show(): void;
|
|
22
22
|
hide(): void;
|
|
23
23
|
setMove(position: Position | Vector3, options?: AnimationOptions, onUpdate?: (source: Position, tween: Tween<Position>) => void, onStart?: (tween: Tween<Position>) => void): Promise<void>;
|
|
24
|
-
setRotate(rotation: Rotation | Euler, options?: AnimationOptions, onUpdate?: (source: Rotation, tween: Tween<
|
|
24
|
+
setRotate(rotation: Rotation | Euler, options?: AnimationOptions, onUpdate?: (source: Rotation, tween: Tween<Interpolate>) => void, onStart?: (tween: Tween<Interpolate>) => void): Promise<void>;
|
|
25
25
|
setScale(scale: Scale | Vector3, options?: AnimationOptions, onUpdate?: (source: Scale, tween: Tween<Scale>) => void, onStart?: (tween: Tween<Scale>) => void): Promise<void>;
|
|
26
26
|
sClone<T extends BaseObject3D>(recursive?: boolean): T;
|
|
27
27
|
sCopy<T extends BaseObject3D>(source: BaseObject3D, recursive?: boolean): T;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { IColor } from '../Interface';
|
|
2
2
|
import { BaseMesh, BaseMeshInfo } from './BaseMesh';
|
|
3
|
+
import { GradientTextureOptions } from '../Shared';
|
|
3
4
|
interface CircleInfo extends BaseMeshInfo {
|
|
4
5
|
radius?: number;
|
|
5
6
|
color?: IColor;
|
|
6
7
|
opacity?: number;
|
|
8
|
+
gradient?: GradientTextureOptions;
|
|
7
9
|
}
|
|
8
10
|
declare type SetOptionsCircleInfo = Omit<CircleInfo, 'id'>;
|
|
9
11
|
declare class Circle extends BaseMesh {
|
package/types/Library/Line.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GradientTextureOptions } from '../Shared';
|
|
1
2
|
import { Position, IColor } from '../Interface';
|
|
2
3
|
import { BaseMesh, BaseMeshInfo } from './BaseMesh';
|
|
3
4
|
interface LineInfo extends BaseMeshInfo {
|
|
@@ -5,6 +6,7 @@ interface LineInfo extends BaseMeshInfo {
|
|
|
5
6
|
width?: number;
|
|
6
7
|
color?: IColor;
|
|
7
8
|
opacity?: number;
|
|
9
|
+
gradient?: GradientTextureOptions;
|
|
8
10
|
}
|
|
9
11
|
declare type SetOptionsLineInfo = Omit<LineInfo, 'id'>;
|
|
10
12
|
declare class Line extends BaseMesh {
|
package/types/Library/Model.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Box3 } from 'three';
|
|
2
2
|
import { BaseObject3D, BaseObject3DInfo } from './BaseObject3D';
|
|
3
|
-
import { ObjectEvents } from '../Interface';
|
|
3
|
+
import { ObjectEvents, ObjectEventsListener } from '../Interface';
|
|
4
4
|
interface ModelInfo extends BaseObject3DInfo, ObjectEvents<Model> {
|
|
5
5
|
url: string;
|
|
6
6
|
}
|
|
7
7
|
interface ModelInnerInfo extends ModelInfo {
|
|
8
8
|
format: string;
|
|
9
9
|
}
|
|
10
|
-
declare class Model extends BaseObject3D implements ObjectEvents<Model> {
|
|
10
|
+
declare class Model extends BaseObject3D<ObjectEventsListener> implements ObjectEvents<Model> {
|
|
11
11
|
readonly formatType: string;
|
|
12
12
|
isEventPropagation: boolean;
|
|
13
13
|
onLoad: ((object: Model) => void) | null;
|
package/types/Library/Poi.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BaseObject3D, BaseObject3DInfo } from './BaseObject3D';
|
|
2
2
|
import { Icon, IconInfo } from './Icon';
|
|
3
3
|
import { SpriteMaterial, Box3 } from 'three';
|
|
4
|
-
import { ObjectEvents, Scale } from '../Interface';
|
|
4
|
+
import { ObjectEvents, ObjectEventsListener, Scale } from '../Interface';
|
|
5
5
|
interface PoiInfo extends BaseObject3DInfo, ObjectEvents<Poi> {
|
|
6
6
|
url: string;
|
|
7
7
|
nameScale?: Scale;
|
|
@@ -13,7 +13,7 @@ interface CanvasTextInfo {
|
|
|
13
13
|
textAlign?: CanvasTextAlign;
|
|
14
14
|
textBaseline?: CanvasTextBaseline;
|
|
15
15
|
}
|
|
16
|
-
declare class Poi extends BaseObject3D implements ObjectEvents<Poi> {
|
|
16
|
+
declare class Poi extends BaseObject3D<ObjectEventsListener> implements ObjectEvents<Poi> {
|
|
17
17
|
icon: Icon;
|
|
18
18
|
text: Icon | null;
|
|
19
19
|
isEventPropagation: boolean;
|
package/types/Library/Point.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { BaseMesh, BaseMeshInfo } from './BaseMesh';
|
|
2
2
|
import { IColor } from '../Interface';
|
|
3
|
+
import { GradientTextureOptions } from '../Shared';
|
|
3
4
|
interface PointInfo extends BaseMeshInfo {
|
|
4
5
|
radius?: number;
|
|
5
6
|
color?: IColor;
|
|
6
7
|
opacity?: number;
|
|
8
|
+
gradient?: GradientTextureOptions;
|
|
7
9
|
}
|
|
8
10
|
declare type SetOptionsPointInfo = Omit<PointInfo, 'id'>;
|
|
9
11
|
declare class Point extends BaseMesh {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { IColor, PlaneIVector2 } from '../Interface';
|
|
2
2
|
import { BaseMesh, BaseMeshInfo } from './BaseMesh';
|
|
3
|
+
import { GradientTextureOptions } from '../Shared';
|
|
3
4
|
interface PolygonInfo extends BaseMeshInfo {
|
|
4
5
|
yHeight: number;
|
|
5
6
|
points: PlaneIVector2[];
|
|
6
7
|
color?: IColor;
|
|
7
8
|
opacity?: number;
|
|
9
|
+
gradient?: GradientTextureOptions;
|
|
8
10
|
}
|
|
9
11
|
declare type SetOptionsPolygonInfo = Omit<PolygonInfo, 'id'>;
|
|
10
12
|
declare class Polygon extends BaseMesh {
|
package/types/Library/Sbm.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Box3 } from 'three';
|
|
2
2
|
import { BaseObject3D, BaseObject3DInfo } from './BaseObject3D';
|
|
3
|
-
import { ObjectEvents } from '../Interface';
|
|
3
|
+
import { ObjectEvents, ObjectEventsListener } from '../Interface';
|
|
4
4
|
interface SbmInfo extends BaseObject3DInfo, ObjectEvents<Sbm> {
|
|
5
5
|
url: string;
|
|
6
6
|
isPlatform?: boolean;
|
|
7
7
|
}
|
|
8
|
-
declare class Sbm extends BaseObject3D implements ObjectEvents<Sbm> {
|
|
8
|
+
declare class Sbm extends BaseObject3D<ObjectEventsListener> implements ObjectEvents<Sbm> {
|
|
9
9
|
isEventPropagation: boolean;
|
|
10
10
|
onLoad: ((object: Sbm) => void) | null;
|
|
11
11
|
onClick: ((object: Sbm) => void) | null;
|
package/types/Shared/map.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
-
import { CubeTexture } from 'three';
|
|
1
|
+
import { CubeTexture, Texture } from 'three';
|
|
2
|
+
import { IColor } from '../Interface';
|
|
2
3
|
declare function getCubeTexture(dirPath: string, fileNames?: string[]): Promise<CubeTexture>;
|
|
3
4
|
export { getCubeTexture, };
|
|
5
|
+
interface GradientTextureOptions {
|
|
6
|
+
colors: IColor[];
|
|
7
|
+
stops?: number[];
|
|
8
|
+
size?: number;
|
|
9
|
+
}
|
|
10
|
+
declare function gradientTexture(options?: GradientTextureOptions): Texture | null;
|
|
11
|
+
export { GradientTextureOptions, gradientTexture, };
|
|
@@ -16,7 +16,7 @@ declare class cameraManager {
|
|
|
16
16
|
getMainCamera(): PerspectiveCamera;
|
|
17
17
|
getCameraViewpoint(): CameraViewpointData;
|
|
18
18
|
setCameraViewpoint(data: CameraViewpointData): void;
|
|
19
|
-
rotateTo(rotation:
|
|
19
|
+
rotateTo(rotation: Euler, options?: AnimationOptions): Promise<void>;
|
|
20
20
|
moveTo(position: Position, options?: AnimationOptions): Promise<void>;
|
|
21
21
|
flyTo(position: Position, rotation?: FlyToViewpoint | Rotation | Euler, options?: AnimationOptions): Promise<void>;
|
|
22
22
|
flyToBoundingBox(bbox: Box3, rotation?: FlyToViewpoint | Rotation | Euler, options?: AnimationOptions): Promise<void>;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Scene, PerspectiveCamera, WebGLRenderer, PMREMGenerator, Vector3, AnimationMixer, Intersection, Object3D, AnimationAction, AnimationClip } from 'three';
|
|
2
|
+
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
2
3
|
import Stats from 'three/examples/jsm/libs/stats.module.js';
|
|
3
4
|
import { Sky } from 'three/examples/jsm/objects/Sky.js';
|
|
4
5
|
import Scener from './Scener';
|
|
5
6
|
import { CSS2DRenderer, CSS2DHalfRenderer, CSS3DRenderer } from '../Renderer';
|
|
6
|
-
import { EffectComposer } from 'three/examples/jsm/postprocessing/EffectComposer.js';
|
|
7
7
|
import RendererManager, { PassObj } from './RendererManager';
|
|
8
8
|
import CameraManager from './CameraManager';
|
|
9
9
|
import { FullFreeControls } from '../Controls';
|
|
10
10
|
import { Model } from '../Library';
|
|
11
11
|
import { ColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, BloomOptions, SobelOptions } from '../Interface';
|
|
12
12
|
import Info from './Info';
|
|
13
|
+
import { ViewHelper } from './ViewHelper';
|
|
13
14
|
export declare const innerRenderState: Record<string, boolean>;
|
|
14
15
|
declare class Viewport {
|
|
15
16
|
options: ViewportOptions;
|
|
@@ -45,9 +46,11 @@ declare class Viewport {
|
|
|
45
46
|
private selectModel;
|
|
46
47
|
private selectPoi;
|
|
47
48
|
private _loop;
|
|
49
|
+
viewHelper: ViewHelper;
|
|
48
50
|
constructor(options: ViewportOptions);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
_initInfo(): void;
|
|
52
|
+
_initStats(): void;
|
|
53
|
+
_initViewHelper(): void;
|
|
51
54
|
setSobel(options?: SobelOptions): void;
|
|
52
55
|
/**
|
|
53
56
|
***************************** renderer ***************************
|
package/types/index.d.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RoomEnvironment, } from './RoomEnvironment';
|