@xviewer.js/core 1.0.0-beta.1 → 1.0.0

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 (83) hide show
  1. package/dist/main.js +3242 -1041
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +3190 -1037
  4. package/dist/module.js.map +1 -1
  5. package/package.json +2 -2
  6. package/types/Component.d.ts +5 -2
  7. package/types/ComponentManager.d.ts +5 -3
  8. package/types/ComponentScheduler.d.ts +7 -3
  9. package/types/DeviceInput.d.ts +0 -1
  10. package/types/Mount.d.ts +4 -0
  11. package/types/ObjectInstance.d.ts +2 -2
  12. package/types/Plugin.d.ts +3 -9
  13. package/types/SystemInfo.d.ts +1 -0
  14. package/types/Task.d.ts +2 -0
  15. package/types/TextureSettings.d.ts +3 -1
  16. package/types/Utils.d.ts +10 -0
  17. package/types/Viewer.d.ts +44 -36
  18. package/types/asset/ResourceManager.d.ts +9 -23
  19. package/types/asset/aLoader.d.ts +8 -2
  20. package/types/base/EventEmitter.d.ts +10 -10
  21. package/types/cinestation/CinestationBlendDefinition.d.ts +4 -4
  22. package/types/cinestation/CinestationBrain.d.ts +0 -2
  23. package/types/cinestation/FreelookVirtualCamera.d.ts +39 -22
  24. package/types/cinestation/VirtualCamera.d.ts +8 -8
  25. package/types/components/Animation.d.ts +26 -0
  26. package/types/components/PerformanceMonitor.d.ts +48 -0
  27. package/types/components/Reflector.d.ts +15 -0
  28. package/types/components/index.d.ts +2 -0
  29. package/types/index.d.ts +13 -3
  30. package/types/{loader → loaders}/aEXRLoader.d.ts +2 -1
  31. package/types/{loader → loaders}/aFBXLoader.d.ts +2 -1
  32. package/types/loaders/aGLTFLoader.d.ts +7 -0
  33. package/types/{loader → loaders}/aHDRLoader.d.ts +2 -1
  34. package/types/{loader → loaders}/aJSONLoader.d.ts +2 -1
  35. package/types/{loader → loaders}/aTextureLoader.d.ts +2 -1
  36. package/types/materials/ReflectorMaterial.d.ts +44 -0
  37. package/types/{material → materials}/getShaderMaterial.d.ts +2 -2
  38. package/types/materials/glsl/index.d.ts +3 -0
  39. package/types/materials/index.d.ts +3 -0
  40. package/types/math/Constant.d.ts +8 -1
  41. package/types/math/Interpolation.d.ts +6 -6
  42. package/types/math/Perlin.d.ts +12 -0
  43. package/types/math/index.d.ts +5 -0
  44. package/types/passes/MipBlurPass.d.ts +27 -0
  45. package/types/passes/cubeuv/MergeBlurPass.d.ts +22 -0
  46. package/types/passes/cubeuv/MergeInfo.d.ts +9 -0
  47. package/types/passes/cubeuv/MergeReflectPass.d.ts +18 -0
  48. package/types/passes/cubeuv/utils.d.ts +16 -0
  49. package/types/passes/mipGaussianBlendWeight.d.ts +1 -0
  50. package/types/plugins/BoxProjection.d.ts +15 -0
  51. package/types/plugins/BoxProjectionPlugin.d.ts +20 -0
  52. package/types/plugins/DebugPlugin.d.ts +10 -0
  53. package/types/plugins/DebugScene.d.ts +8 -0
  54. package/types/plugins/DropFile.d.ts +18 -0
  55. package/types/plugins/DropFilePlugin.d.ts +18 -0
  56. package/types/plugins/Environment.d.ts +37 -0
  57. package/types/plugins/EnvironmentPlugin.d.ts +41 -0
  58. package/types/plugins/PerformanceMonitor.d.ts +48 -0
  59. package/types/plugins/PerformanceMonitorPlugin.d.ts +48 -0
  60. package/types/plugins/index.d.ts +4 -0
  61. package/types/tween/Easing.d.ts +25 -0
  62. package/types/tween/Group.d.ts +16 -0
  63. package/types/tween/Interpolation.d.ts +19 -0
  64. package/types/tween/Now.d.ts +2 -0
  65. package/types/tween/Sequence.d.ts +7 -0
  66. package/types/tween/Tween.d.ts +98 -0
  67. package/types/tween/TweenChain.d.ts +18 -7
  68. package/types/tween/TweenGroup.d.ts +17 -0
  69. package/types/tween/TweenManager.d.ts +3 -5
  70. package/types/tween/Version.d.ts +1 -0
  71. package/types/tween/index.d.ts +4 -1
  72. package/types/tween/mainGroup.d.ts +2 -0
  73. package/types/types.d.ts +8 -0
  74. package/types/loader/aGLTFLoader.d.ts +0 -5
  75. package/types/material/glsl/copy.glsl.d.ts +0 -1
  76. /package/types/{loader → loaders}/index.d.ts +0 -0
  77. /package/types/{material → materials}/glsl/boxfilterblur.glsl.d.ts +0 -0
  78. /package/types/{material → materials}/glsl/fullscreen.glsl.d.ts +0 -0
  79. /package/types/{material → materials}/glsl/panorama.glsl.d.ts +0 -0
  80. /package/types/{primitives → primitive}/Box.d.ts +0 -0
  81. /package/types/{primitives → primitive}/Plane.d.ts +0 -0
  82. /package/types/{primitives → primitive}/Sphere.d.ts +0 -0
  83. /package/types/{primitives → primitive}/index.d.ts +0 -0
@@ -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,2 @@
1
+ declare const now: () => number;
2
+ export { now };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Utils
3
+ */
4
+ export declare class Sequence {
5
+ private static _nextId;
6
+ static nextId(): number;
7
+ }
@@ -0,0 +1,98 @@
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 { TweenGroup } from './TweenGroup';
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?: TweenGroup | false);
49
+ getId(): number;
50
+ getObject(): T;
51
+ getGroup(): false | TweenGroup;
52
+ isPlaying(): boolean;
53
+ isPaused(): boolean;
54
+ getDuration(): number;
55
+ from(properties: UnknownProps): this;
56
+ to(target: UnknownProps, duration?: number): this;
57
+ duration(duration?: number): this;
58
+ dynamic(dynamic?: boolean): this;
59
+ start(time: number, overrideStartingValues?: boolean): this;
60
+ startFromCurrentValues(time?: number): this;
61
+ private _setupProperties;
62
+ stop(): this;
63
+ end(): this;
64
+ pause(time: number): this;
65
+ resume(time: number): this;
66
+ stopChainedTweens(): this;
67
+ group(group?: TweenGroup): this;
68
+ call(callback: (object: T) => void): this;
69
+ delay(amount?: number): this;
70
+ union(headTween: Tween<T>, tailTween: Tween<T>): this;
71
+ repeat(times?: number): this;
72
+ repeatDelay(amount?: number): this;
73
+ yoyo(yoyo?: boolean): this;
74
+ easing(easingFunction?: EasingFunction): this;
75
+ interpolation(interpolationFunction?: InterpolationFunction): this;
76
+ chain(...tweens: Array<Tween<any>>): this;
77
+ unchain(...tweens: Array<Tween<any>>): this;
78
+ onStart(callback?: (object: T) => void): this;
79
+ onEveryStart(callback?: (object: T) => void): this;
80
+ onUpdate(callback?: (object: T, elapsed: number) => void): this;
81
+ onRepeat(callback?: (object: T) => void): this;
82
+ onComplete(callback?: (object: T) => void): this;
83
+ onStop(callback?: (object: T) => void): this;
84
+ private _goToEnd;
85
+ /**
86
+ * @returns true if the tween is still playing after the update, false
87
+ * otherwise (calling update on a paused tween still returns true because
88
+ * it is still playing, just paused).
89
+ */
90
+ update(time: number, autoStart?: boolean): boolean;
91
+ private _calculateElapsedPortion;
92
+ private _calculateCompletionStatus;
93
+ private _processRepetition;
94
+ private _updateProperties;
95
+ private _handleRelativeValue;
96
+ private _swapEndStartRepeatValues;
97
+ }
98
+ export type UnknownProps = Record<string, any>;
@@ -1,15 +1,26 @@
1
- import { Group, Tween } from "./tween";
1
+ import { Tween } from "./Tween";
2
+ import { TweenGroup } from "./TweenGroup";
2
3
  export declare class TweenChain {
3
- private _object;
4
+ private _obj;
5
+ private _group;
4
6
  private _tween;
5
7
  private _chainedTween;
6
- constructor(object: Object, group?: Group);
8
+ constructor(object: Object, group?: TweenGroup);
7
9
  start(): this;
10
+ pause(): this;
8
11
  stop(): this;
9
- repeat(times: any): this;
12
+ repeat(times: number): this;
10
13
  union(): this;
11
- call(callback: any): this;
12
- delay(amount: any): this;
13
- to(properties: any, duration: any, props: any): this;
14
+ call(callback: (object: Object) => void): this;
15
+ delay(amount: number): this;
16
+ to(properties: Record<string, any>, duration?: number, props?: {
17
+ from?: Record<string, any>;
18
+ easing?: (amount: number) => number;
19
+ onStart?: (object: Object) => void;
20
+ onStop?: (object: Object) => void;
21
+ onComplete?: (object: Object) => void;
22
+ onUpdate?: (object: Object, elapsed: number) => void;
23
+ onRepeat?: (object: Object) => void;
24
+ }): this;
14
25
  _chainTween(): Tween<Object>;
15
26
  }
@@ -0,0 +1,17 @@
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 TweenGroup {
9
+ private _tweens;
10
+ private _tweensAddedDuringUpdate;
11
+ getAll(): Array<Tween<UnknownProps>>;
12
+ removeAll(): void;
13
+ removeOf(target: Object): void;
14
+ add(tween: Tween<UnknownProps>): void;
15
+ remove(tween: Tween<UnknownProps>): void;
16
+ update(time: number, preserve?: boolean): boolean;
17
+ }
@@ -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
- destroy(): void;
6
- update(time: number): void;
7
- tween(target: Object): Tween<Object>;
4
+ update(dt: number): void;
8
5
  timeline(target: Object): TweenChain;
9
- killTweensOf(target: Object): void;
6
+ killAll(): void;
7
+ killOf(target: Object): void;
10
8
  }
@@ -0,0 +1 @@
1
+ export declare const VERSION = "23.1.2";
@@ -1,3 +1,6 @@
1
+ export { TweenGroup } from "./TweenGroup";
1
2
  export { TweenChain } from "./TweenChain";
2
3
  export { TweenManager } from "./TweenManager";
3
- export { Tween } from "./tween";
4
+ export { Tween } from "./Tween";
5
+ export type { EasingFunction } from "./Easing";
6
+ export { Easing } from "./Easing";
@@ -0,0 +1,2 @@
1
+ import { TweenGroup } from './TweenGroup';
2
+ export declare const mainGroup: TweenGroup;
package/types/types.d.ts CHANGED
@@ -8,6 +8,10 @@ export type __Properties<T> = Omit<Partial<T>, __FunctionKeys<T>> & {
8
8
  };
9
9
  export type __C<T> = new (...args: any[]) => T;
10
10
  export type __P<T, K extends __C<T>> = __Properties<T> & {
11
+ /**
12
+ * Target node for component
13
+ */
14
+ node?: Object3D;
11
15
  /**
12
16
  * Set contructor parameters of node
13
17
  */
@@ -45,6 +49,10 @@ export type __P<T, K extends __C<T>> = __Properties<T> & {
45
49
  * Object's local rotation
46
50
  */
47
51
  rotation?: Euler;
52
+ /**
53
+ * Object's layer mask
54
+ */
55
+ layer?: number;
48
56
  };
49
57
  export type __Comp<T, K extends __C<T>> = __Properties<T> & {
50
58
  /**
@@ -1,5 +0,0 @@
1
- import { LoadProperties, aLoader } from "../asset/aLoader";
2
- export declare class aGLTFLoader extends aLoader {
3
- extension: string[];
4
- load({ url, onLoad, onProgress, onError }: LoadProperties): void;
5
- }
@@ -1 +0,0 @@
1
- export declare const frag_Copy = "\nvarying vec2 vUv;\nuniform sampler2D tMain;\nuniform float uLod;\n\nvoid main() {\n gl_FragColor = texture(tMain, vUv, uLod);\n\t#include <encodings_fragment>\n}\n";
File without changes
File without changes
File without changes
File without changes
File without changes