@xviewer.js/core 1.0.0-alpha.33 → 1.0.0-alpha.35
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/main.js +703 -585
- package/dist/main.js.map +1 -1
- package/dist/module.js +704 -586
- package/dist/module.js.map +1 -1
- package/package.json +1 -1
- package/types/Viewer.d.ts +0 -1
- package/types/cinestation/CinestationBlendDefinition.d.ts +4 -4
- package/types/cinestation/CinestationBrain.d.ts +0 -2
- package/types/cinestation/FreelookVirtualCamera.d.ts +36 -17
- package/types/cinestation/VirtualCamera.d.ts +7 -8
- package/types/math/Interpolation.d.ts +6 -6
- package/types/tween/Easing.d.ts +25 -0
- package/types/tween/Group.d.ts +16 -0
- package/types/tween/Interpolation.d.ts +19 -0
- package/types/tween/Now.d.ts +2 -0
- package/types/tween/Sequence.d.ts +7 -0
- package/types/tween/Tween.d.ts +96 -0
- package/types/tween/TweenChain.d.ts +2 -1
- package/types/tween/TweenManager.d.ts +0 -2
- package/types/tween/Version.d.ts +1 -0
- package/types/tween/index.d.ts +3 -1
- package/types/tween/mainGroup.d.ts +2 -0
- package/types/objects/Reflector.d.ts +0 -18
- package/types/objects/index.d.ts +0 -1
package/package.json
CHANGED
package/types/Viewer.d.ts
CHANGED
|
@@ -114,7 +114,6 @@ export declare class Viewer extends EventEmitter {
|
|
|
114
114
|
loadAsset(props: AssetProperties & TextureSettings): Promise<any>;
|
|
115
115
|
addLoader(Loader: LoaderConstructor): void;
|
|
116
116
|
load({ url, ext, onProgress, castShadow, receiveShadow, ...props }: AssetProperties & __P<Object3D, typeof Object3D>): Promise<any>;
|
|
117
|
-
tween(target: Object): import("./tween").Tween<Object>;
|
|
118
117
|
timeline(target: Object): import("./tween").TweenChain;
|
|
119
118
|
killTweensOf(target: Object): void;
|
|
120
119
|
traverseMaterials(callback: (mat: Material) => void): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare const CinestationBlendStyle: {
|
|
2
|
-
Linear: (
|
|
3
|
-
QuadraticIn: (
|
|
4
|
-
QuadraticOut: (
|
|
5
|
-
QuadraticInOut: (
|
|
2
|
+
Linear: import("../tween").EasingFunction;
|
|
3
|
+
QuadraticIn: import("../tween").EasingFunction;
|
|
4
|
+
QuadraticOut: import("../tween").EasingFunction;
|
|
5
|
+
QuadraticInOut: import("../tween").EasingFunction;
|
|
6
6
|
};
|
|
7
7
|
export type CinestationBlendStyle = typeof CinestationBlendStyle[keyof typeof CinestationBlendStyle];
|
|
8
8
|
export declare class CinestationBlendDefinition {
|
|
@@ -7,9 +7,7 @@ export declare class CinestationBrain extends Component<PerspectiveCamera> {
|
|
|
7
7
|
private _vcamSolo;
|
|
8
8
|
private _vcams;
|
|
9
9
|
private _lerpTime;
|
|
10
|
-
private _isChanged;
|
|
11
10
|
brainBlend: CinestationBlendDefinition;
|
|
12
|
-
onChanged: (v: boolean) => void;
|
|
13
11
|
get vcam(): VirtualCamera;
|
|
14
12
|
get vcams(): VirtualCamera[];
|
|
15
13
|
lastUpdate(dt: number): void;
|
|
@@ -1,49 +1,59 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Quaternion, Vector2, Vector3 } from "three";
|
|
2
2
|
import { VirtualCamera } from "./VirtualCamera";
|
|
3
3
|
export declare class FreelookVirtualCamera extends VirtualCamera {
|
|
4
4
|
static __loc0: Vector2;
|
|
5
5
|
static __loc1: Vector2;
|
|
6
6
|
static __center: Vector2;
|
|
7
7
|
static __preCenter: Vector2;
|
|
8
|
-
static
|
|
9
|
-
static
|
|
8
|
+
static __panDelta: Vector2;
|
|
9
|
+
static __panTarget: Vector2;
|
|
10
|
+
static __rotateDelta: Vector2;
|
|
10
11
|
static __posDelta: Vector3;
|
|
11
12
|
static __xAxis: Vector3;
|
|
12
13
|
static __yAxis: Vector3;
|
|
13
14
|
static __quat: Quaternion;
|
|
14
|
-
static __spherical: Spherical;
|
|
15
|
-
static __offsetDelta: Vector3;
|
|
16
15
|
private _button;
|
|
17
16
|
private _touchID;
|
|
18
|
-
private _distanceDelta;
|
|
19
17
|
private _preLoc0;
|
|
20
18
|
private _preLoc1;
|
|
21
|
-
private
|
|
22
|
-
private
|
|
19
|
+
private _spherical;
|
|
20
|
+
private _lookAt;
|
|
23
21
|
private _tempSmoothing;
|
|
24
|
-
private
|
|
22
|
+
private _targetTheta;
|
|
23
|
+
private _targetPhi;
|
|
24
|
+
private _targetSpringLength;
|
|
25
|
+
private _targetFov;
|
|
26
|
+
private _targetLookAt;
|
|
27
|
+
private _targetSpherical;
|
|
25
28
|
forbidX: boolean;
|
|
26
29
|
forbidY: boolean;
|
|
27
30
|
forbidZ: boolean;
|
|
28
31
|
forbidPanX: boolean;
|
|
29
32
|
forbidPanY: boolean;
|
|
30
33
|
forbitPanOffsetY: boolean;
|
|
31
|
-
printInfo(): void;
|
|
32
|
-
smoothing: number;
|
|
33
|
-
rotateSpeed: number;
|
|
34
34
|
panSpeed: number;
|
|
35
|
-
|
|
35
|
+
rotateSpeed: number;
|
|
36
|
+
smoothing: number;
|
|
36
37
|
phiMin: number;
|
|
37
38
|
phiMax: number;
|
|
38
39
|
thetaMin: number;
|
|
39
40
|
thetaMax: number;
|
|
40
41
|
distanceMin: number;
|
|
41
42
|
distanceMax: number;
|
|
42
|
-
|
|
43
|
-
lookAt:
|
|
43
|
+
get lookAt(): Vector3;
|
|
44
|
+
set lookAt(v: Vector3);
|
|
45
|
+
get springLength(): number;
|
|
46
|
+
set springLength(v: number);
|
|
47
|
+
get theta(): number;
|
|
48
|
+
set theta(v: number);
|
|
49
|
+
get phi(): number;
|
|
50
|
+
set phi(v: number);
|
|
51
|
+
get fov(): number;
|
|
52
|
+
set fov(v: number);
|
|
44
53
|
onEnable(): void;
|
|
45
54
|
onDisable(): void;
|
|
46
55
|
reset(): void;
|
|
56
|
+
private _setSpherical;
|
|
47
57
|
private _onPointerDown;
|
|
48
58
|
private _onPointerUp;
|
|
49
59
|
private _onPointerMove;
|
|
@@ -51,8 +61,17 @@ export declare class FreelookVirtualCamera extends VirtualCamera {
|
|
|
51
61
|
private _onTouchStart;
|
|
52
62
|
private _onTouchMove;
|
|
53
63
|
private _calculateDistanceScale;
|
|
54
|
-
private
|
|
64
|
+
private _calculateRotatelDelta;
|
|
55
65
|
private _calculatePanDelta;
|
|
56
|
-
|
|
66
|
+
private _calculateTargetLookAt;
|
|
67
|
+
private _calculateTargetSpringArm;
|
|
68
|
+
gotoPOI({ springLength, theta, phi, lookAt, fov, smoothing }: {
|
|
69
|
+
springLength?: number;
|
|
70
|
+
theta?: number;
|
|
71
|
+
phi?: number;
|
|
72
|
+
lookAt?: Vector3;
|
|
73
|
+
fov?: number;
|
|
74
|
+
smoothing?: number;
|
|
75
|
+
}): void;
|
|
57
76
|
update(dt: number): void;
|
|
58
77
|
}
|
|
@@ -1,25 +1,24 @@
|
|
|
1
1
|
import { Object3D, Quaternion, Vector3 } from "three";
|
|
2
2
|
import { Component } from "../Component";
|
|
3
3
|
import { CinestationBrain } from "./CinestationBrain";
|
|
4
|
+
declare class Lens {
|
|
5
|
+
fov: number;
|
|
6
|
+
near: number;
|
|
7
|
+
far: number;
|
|
8
|
+
}
|
|
4
9
|
export declare class VirtualCamera extends Component<Object3D & {
|
|
5
10
|
isCamera?: boolean;
|
|
6
11
|
}> {
|
|
7
12
|
private _finalPosition;
|
|
8
13
|
private _finalRotation;
|
|
9
14
|
priority: number;
|
|
10
|
-
|
|
11
|
-
follow: Object3D | null;
|
|
12
|
-
fov: number;
|
|
13
|
-
near: number;
|
|
14
|
-
far: number;
|
|
15
|
+
lens: Lens;
|
|
15
16
|
correctPosition: Vector3;
|
|
16
17
|
correctRotation: Quaternion;
|
|
17
|
-
lookaheadPosition: Vector3;
|
|
18
|
-
lookAtOffset: Vector3;
|
|
19
18
|
brain: CinestationBrain;
|
|
20
19
|
get finalPosition(): Vector3;
|
|
21
20
|
get finalRotation(): Quaternion;
|
|
22
21
|
onLoad(): void;
|
|
23
22
|
onDestroy(): void;
|
|
24
|
-
update(dt: number): void;
|
|
25
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Quaternion } from "three";
|
|
2
|
-
export declare function VInterpTo(current:
|
|
3
|
-
export declare function VInterpConstantTo(current:
|
|
1
|
+
import { Quaternion, Vector3 } from "three";
|
|
2
|
+
export declare function VInterpTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
|
|
3
|
+
export declare function VInterpConstantTo(current: Vector3, target: Vector3, deltaTime: number, speed: number, out?: Vector3): Vector3;
|
|
4
4
|
export declare function Quat_Equals(a: Quaternion, b: Quaternion, epsilon?: number): boolean;
|
|
5
5
|
export declare function Quat_AngularDistance(a: Quaternion, b: Quaternion): number;
|
|
6
6
|
export declare function QInterpTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number): Quaternion;
|
|
7
|
-
export declare function QInterpConstantTo(current:
|
|
8
|
-
export declare function FInterpTo(current:
|
|
9
|
-
export declare function FInterpConstantTo(current:
|
|
7
|
+
export declare function QInterpConstantTo(current: Quaternion, target: Quaternion, deltaTime: number, speed: number, out?: Quaternion): Quaternion;
|
|
8
|
+
export declare function FInterpTo(current: number, target: number, deltaTime: number, speed: number): number;
|
|
9
|
+
export declare function FInterpConstantTo(current: number, target: number, deltaTime: number, speed: number): number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export type EasingFunction = (amount: number) => number;
|
|
2
|
+
export type EasingFunctionGroup = {
|
|
3
|
+
In: EasingFunction;
|
|
4
|
+
Out: EasingFunction;
|
|
5
|
+
InOut: EasingFunction;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The Ease class provides a collection of easing functions for use with tween.js.
|
|
9
|
+
*/
|
|
10
|
+
export declare const Easing: Readonly<{
|
|
11
|
+
Linear: Readonly<EasingFunctionGroup & {
|
|
12
|
+
None: EasingFunction;
|
|
13
|
+
}>;
|
|
14
|
+
Quadratic: Readonly<EasingFunctionGroup>;
|
|
15
|
+
Cubic: Readonly<EasingFunctionGroup>;
|
|
16
|
+
Quartic: Readonly<EasingFunctionGroup>;
|
|
17
|
+
Quintic: Readonly<EasingFunctionGroup>;
|
|
18
|
+
Sinusoidal: Readonly<EasingFunctionGroup>;
|
|
19
|
+
Exponential: Readonly<EasingFunctionGroup>;
|
|
20
|
+
Circular: Readonly<EasingFunctionGroup>;
|
|
21
|
+
Elastic: Readonly<EasingFunctionGroup>;
|
|
22
|
+
Back: Readonly<EasingFunctionGroup>;
|
|
23
|
+
Bounce: Readonly<EasingFunctionGroup>;
|
|
24
|
+
generatePow(power?: number): EasingFunctionGroup;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Tween, UnknownProps } from './Tween';
|
|
2
|
+
/**
|
|
3
|
+
* Controlling groups of tweens
|
|
4
|
+
*
|
|
5
|
+
* Using the TWEEN singleton to manage your tweens can cause issues in large apps with many components.
|
|
6
|
+
* In these cases, you may want to create your own smaller groups of tween
|
|
7
|
+
*/
|
|
8
|
+
export declare class Group {
|
|
9
|
+
private _tweens;
|
|
10
|
+
private _tweensAddedDuringUpdate;
|
|
11
|
+
getAll(): Array<Tween<UnknownProps>>;
|
|
12
|
+
removeAll(): void;
|
|
13
|
+
add(tween: Tween<UnknownProps>): void;
|
|
14
|
+
remove(tween: Tween<UnknownProps>): void;
|
|
15
|
+
update(time?: number, preserve?: boolean): boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
*/
|
|
4
|
+
export type InterpolationFunction = (v: number[], k: number) => number;
|
|
5
|
+
/**
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
declare const Interpolation: {
|
|
9
|
+
Linear: (v: number[], k: number) => number;
|
|
10
|
+
Bezier: (v: number[], k: number) => number;
|
|
11
|
+
CatmullRom: (v: number[], k: number) => number;
|
|
12
|
+
Utils: {
|
|
13
|
+
Linear: (p0: number, p1: number, t: number) => number;
|
|
14
|
+
Bernstein: (n: number, i: number) => number;
|
|
15
|
+
Factorial: (n: number) => number;
|
|
16
|
+
CatmullRom: (p0: number, p1: number, p2: number, p3: number, t: number) => number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export { Interpolation };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tween.js - Licensed under the MIT license
|
|
3
|
+
* https://github.com/tweenjs/tween.js
|
|
4
|
+
* ----------------------------------------------
|
|
5
|
+
*
|
|
6
|
+
* See https://github.com/tweenjs/tween.js/graphs/contributors for the full list of contributors.
|
|
7
|
+
* Thank you all, you're awesome!
|
|
8
|
+
*/
|
|
9
|
+
import type { EasingFunction } from './Easing';
|
|
10
|
+
import type { InterpolationFunction } from './Interpolation';
|
|
11
|
+
import type { Group } from './Group';
|
|
12
|
+
export declare class Tween<T extends UnknownProps> {
|
|
13
|
+
private _object;
|
|
14
|
+
private _group;
|
|
15
|
+
private _isPaused;
|
|
16
|
+
private _pauseStart;
|
|
17
|
+
private _valuesStart;
|
|
18
|
+
private _valuesEnd;
|
|
19
|
+
private _valuesStartRepeat;
|
|
20
|
+
private _duration;
|
|
21
|
+
private _isDynamic;
|
|
22
|
+
private _initialRepeat;
|
|
23
|
+
private _repeat;
|
|
24
|
+
private _repeatDelayTime?;
|
|
25
|
+
private _yoyo;
|
|
26
|
+
private _isPlaying;
|
|
27
|
+
private _reversed;
|
|
28
|
+
private _delayTime;
|
|
29
|
+
private _startTime;
|
|
30
|
+
private _easingFunction;
|
|
31
|
+
private _interpolationFunction;
|
|
32
|
+
private _chainedTweens;
|
|
33
|
+
private _onStartCallback?;
|
|
34
|
+
private _onStartCallbackFired;
|
|
35
|
+
private _onEveryStartCallback?;
|
|
36
|
+
private _onEveryStartCallbackFired;
|
|
37
|
+
private _onUpdateCallback?;
|
|
38
|
+
private _onRepeatCallback?;
|
|
39
|
+
private _onCompleteCallback?;
|
|
40
|
+
private _onStopCallback?;
|
|
41
|
+
private _onFinishCallback?;
|
|
42
|
+
private _id;
|
|
43
|
+
private _isChainStopped;
|
|
44
|
+
private _propertiesAreSetUp;
|
|
45
|
+
private _headTween;
|
|
46
|
+
private _tailTween;
|
|
47
|
+
private _headTweenStartFired;
|
|
48
|
+
constructor(_object: T, _group?: Group | false);
|
|
49
|
+
getId(): number;
|
|
50
|
+
isPlaying(): boolean;
|
|
51
|
+
isPaused(): boolean;
|
|
52
|
+
getDuration(): number;
|
|
53
|
+
from(properties: UnknownProps): this;
|
|
54
|
+
to(target: UnknownProps, duration?: number): this;
|
|
55
|
+
duration(duration?: number): this;
|
|
56
|
+
dynamic(dynamic?: boolean): this;
|
|
57
|
+
start(time?: number, overrideStartingValues?: boolean): this;
|
|
58
|
+
startFromCurrentValues(time?: number): this;
|
|
59
|
+
private _setupProperties;
|
|
60
|
+
stop(): this;
|
|
61
|
+
end(): this;
|
|
62
|
+
pause(time?: number): this;
|
|
63
|
+
resume(time?: number): this;
|
|
64
|
+
stopChainedTweens(): this;
|
|
65
|
+
group(group?: Group): this;
|
|
66
|
+
call(callback: (object: T) => void): this;
|
|
67
|
+
delay(amount?: number): this;
|
|
68
|
+
union(headTween: Tween<T>, tailTween: Tween<T>): this;
|
|
69
|
+
repeat(times?: number): this;
|
|
70
|
+
repeatDelay(amount?: number): this;
|
|
71
|
+
yoyo(yoyo?: boolean): this;
|
|
72
|
+
easing(easingFunction?: EasingFunction): this;
|
|
73
|
+
interpolation(interpolationFunction?: InterpolationFunction): this;
|
|
74
|
+
chain(...tweens: Array<Tween<any>>): this;
|
|
75
|
+
unchain(...tweens: Array<Tween<any>>): this;
|
|
76
|
+
onStart(callback?: (object: T) => void): this;
|
|
77
|
+
onEveryStart(callback?: (object: T) => void): this;
|
|
78
|
+
onUpdate(callback?: (object: T, elapsed: number) => void): this;
|
|
79
|
+
onRepeat(callback?: (object: T) => void): this;
|
|
80
|
+
onComplete(callback?: (object: T) => void): this;
|
|
81
|
+
onStop(callback?: (object: T) => void): this;
|
|
82
|
+
private _goToEnd;
|
|
83
|
+
/**
|
|
84
|
+
* @returns true if the tween is still playing after the update, false
|
|
85
|
+
* otherwise (calling update on a paused tween still returns true because
|
|
86
|
+
* it is still playing, just paused).
|
|
87
|
+
*/
|
|
88
|
+
update(time?: number, autoStart?: boolean): boolean;
|
|
89
|
+
private _calculateElapsedPortion;
|
|
90
|
+
private _calculateCompletionStatus;
|
|
91
|
+
private _processRepetition;
|
|
92
|
+
private _updateProperties;
|
|
93
|
+
private _handleRelativeValue;
|
|
94
|
+
private _swapEndStartRepeatValues;
|
|
95
|
+
}
|
|
96
|
+
export type UnknownProps = Record<string, any>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { TweenChain } from "./TweenChain";
|
|
2
|
-
import { Tween } from "./tween";
|
|
3
2
|
export declare class TweenManager {
|
|
4
3
|
private _group;
|
|
5
4
|
destroy(): void;
|
|
6
5
|
update(time: number): void;
|
|
7
|
-
tween(target: Object): Tween<Object>;
|
|
8
6
|
timeline(target: Object): TweenChain;
|
|
9
7
|
killTweensOf(target: Object): void;
|
|
10
8
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "23.1.2";
|
package/types/tween/index.d.ts
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BufferGeometry, ColorRepresentation, Matrix4, Mesh, Vector3, WebGLRenderTarget, ShaderMaterial } from "three";
|
|
2
|
-
export declare class Reflector extends Mesh<BufferGeometry, ShaderMaterial> {
|
|
3
|
-
isReflector: boolean;
|
|
4
|
-
constructor(options?: {
|
|
5
|
-
textureWidth?: number;
|
|
6
|
-
textureHeight?: number;
|
|
7
|
-
clipBias?: number;
|
|
8
|
-
multisample?: number;
|
|
9
|
-
color?: ColorRepresentation;
|
|
10
|
-
normal?: Vector3;
|
|
11
|
-
material?: ShaderMaterial;
|
|
12
|
-
geometry?: BufferGeometry;
|
|
13
|
-
layer?: number;
|
|
14
|
-
});
|
|
15
|
-
getTextureMatrix: () => Matrix4;
|
|
16
|
-
getRenderTarget: () => WebGLRenderTarget;
|
|
17
|
-
dispose: () => void;
|
|
18
|
-
}
|
package/types/objects/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { Reflector } from "./Reflector";
|