@configura/babylon-view 2.1.0-alpha.0 → 2.1.0-alpha.1
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/.eslintrc.json +5 -5
- package/LICENSE +201 -201
- package/README.md +1 -1
- package/dist/animation/AnimatableObject.d.ts +8 -8
- package/dist/animation/AnimatableObject.js +3 -3
- package/dist/animation/animator/Animator.d.ts +33 -33
- package/dist/animation/animator/Animator.js +58 -58
- package/dist/animation/animator/AnimatorEasing.d.ts +16 -16
- package/dist/animation/animator/AnimatorEasing.js +31 -31
- package/dist/animation/animator/AnimatorEasingMatrix.d.ts +14 -14
- package/dist/animation/animator/AnimatorEasingMatrix.js +16 -16
- package/dist/animation/animator/AnimatorHighlight.d.ts +16 -16
- package/dist/animation/animator/AnimatorHighlight.js +32 -32
- package/dist/animation/animator/AnimatorPointToPoint.d.ts +8 -8
- package/dist/animation/animator/AnimatorPointToPoint.js +14 -14
- package/dist/animation/animator/AnimatorQueue.d.ts +13 -13
- package/dist/animation/animator/AnimatorQueue.js +57 -57
- package/dist/animation/animator/AnimatorScale.d.ts +8 -8
- package/dist/animation/animator/AnimatorScale.js +13 -13
- package/dist/animation/animator/AnimatorSpin.d.ts +10 -10
- package/dist/animation/animator/AnimatorSpin.js +13 -13
- package/dist/animation/animator/EasingFunctions.d.ts +35 -35
- package/dist/animation/animator/EasingFunctions.js +137 -137
- package/dist/animation/coordinator/Coordinator.d.ts +28 -28
- package/dist/animation/coordinator/Coordinator.js +53 -53
- package/dist/animation/coordinator/CoordinatorDropAndSpin.d.ts +22 -22
- package/dist/animation/coordinator/CoordinatorDropAndSpin.js +138 -138
- package/dist/animation/coordinator/CoordinatorIdentity.d.ts +11 -11
- package/dist/animation/coordinator/CoordinatorIdentity.js +14 -14
- package/dist/animation/coordinator/CoordinatorNodeQueues.d.ts +18 -18
- package/dist/animation/coordinator/CoordinatorNodeQueues.js +50 -50
- package/dist/animation/coordinator/CoordinatorPulse.d.ts +21 -21
- package/dist/animation/coordinator/CoordinatorPulse.js +47 -47
- package/dist/animation/coordinator/CoordinatorPulseBounce.d.ts +14 -14
- package/dist/animation/coordinator/CoordinatorPulseBounce.js +35 -35
- package/dist/animation/coordinator/CoordinatorPulseHighlight.d.ts +13 -13
- package/dist/animation/coordinator/CoordinatorPulseHighlight.js +29 -29
- package/dist/animation/coordinator/CoordinatorPulseInflate.d.ts +14 -14
- package/dist/animation/coordinator/CoordinatorPulseInflate.js +23 -23
- package/dist/camera/CameraCreator.d.ts +5 -5
- package/dist/camera/CameraCreator.js +4 -4
- package/dist/camera/CfgArcRotateCameraPointersInput.d.ts +26 -26
- package/dist/camera/CfgArcRotateCameraPointersInput.js +266 -266
- package/dist/camera/CfgOrbitalCamera.d.ts +76 -76
- package/dist/camera/CfgOrbitalCamera.js +281 -281
- package/dist/camera/CfgOrbitalCameraControlProps.d.ts +14 -14
- package/dist/camera/CfgOrbitalCameraControlProps.js +7 -7
- package/dist/camera/GradingApplier.d.ts +3 -3
- package/dist/camera/GradingApplier.js +48 -48
- package/dist/engine/EngineCreator.d.ts +3 -3
- package/dist/engine/EngineCreator.js +10 -10
- package/dist/geometry/CfgGeometry.d.ts +29 -29
- package/dist/geometry/CfgGeometry.js +146 -146
- package/dist/geometry/CfgMesh.d.ts +10 -10
- package/dist/geometry/CfgMesh.js +38 -38
- package/dist/geometry/geoSplitter.d.ts +8 -8
- package/dist/geometry/geoSplitter.js +192 -192
- package/dist/geometry/stretch/CfgMorphTarget.d.ts +15 -15
- package/dist/geometry/stretch/CfgMorphTarget.js +65 -65
- package/dist/geometry/stretch/CfgStretchData.d.ts +116 -116
- package/dist/geometry/stretch/CfgStretchData.js +350 -350
- package/dist/geometry/stretch/CfgStretchMorphGeometry.d.ts +16 -16
- package/dist/geometry/stretch/CfgStretchMorphGeometry.js +95 -95
- package/dist/index.d.ts +16 -16
- package/dist/index.js +16 -16
- package/dist/io/CfgHistoryToCameraConfConnector.d.ts +31 -31
- package/dist/io/CfgHistoryToCameraConfConnector.js +90 -90
- package/dist/io/CfgIOCameraConfConnector.d.ts +35 -35
- package/dist/io/CfgIOCameraConfConnector.js +81 -81
- package/dist/io/CfgObservableStateToCameraConfConnector.d.ts +10 -10
- package/dist/io/CfgObservableStateToCameraConfConnector.js +11 -11
- package/dist/io/CfgWindowMessageToCameraConfConnector.d.ts +10 -10
- package/dist/io/CfgWindowMessageToCameraConfConnector.js +11 -11
- package/dist/light/CfgDirectionalLight.d.ts +8 -8
- package/dist/light/CfgDirectionalLight.js +18 -18
- package/dist/light/CfgHemisphericLight.d.ts +7 -7
- package/dist/light/CfgHemisphericLight.js +17 -17
- package/dist/light/CfgPointLight.d.ts +8 -8
- package/dist/light/CfgPointLight.js +18 -18
- package/dist/light/DefaultLightRig.d.ts +19 -19
- package/dist/light/DefaultLightRig.js +77 -77
- package/dist/light/LightRigCreator.d.ts +9 -9
- package/dist/light/LightRigCreator.js +3 -3
- package/dist/material/CfgMaterial.d.ts +68 -68
- package/dist/material/CfgMaterial.js +482 -482
- package/dist/material/DummyMaterialCreator.d.ts +4 -4
- package/dist/material/DummyMaterialCreator.js +15 -15
- package/dist/material/material.d.ts +18 -18
- package/dist/material/material.js +128 -128
- package/dist/material/texture.d.ts +14 -14
- package/dist/material/texture.js +306 -306
- package/dist/nodes/CfgContentRootNode.d.ts +19 -19
- package/dist/nodes/CfgContentRootNode.js +75 -75
- package/dist/nodes/CfgDeferredMeshNode.d.ts +55 -55
- package/dist/nodes/CfgDeferredMeshNode.js +378 -378
- package/dist/nodes/CfgProductNode.d.ts +127 -127
- package/dist/nodes/CfgProductNode.js +598 -598
- package/dist/nodes/CfgSymNode.d.ts +50 -50
- package/dist/nodes/CfgSymNode.js +249 -249
- package/dist/nodes/CfgSymRootNode.d.ts +45 -45
- package/dist/nodes/CfgSymRootNode.js +229 -229
- package/dist/nodes/CfgTransformNode.d.ts +33 -33
- package/dist/nodes/CfgTransformNode.js +83 -83
- package/dist/scene/SceneCreator.d.ts +6 -6
- package/dist/scene/SceneCreator.js +22 -22
- package/dist/utilities/CfgBoundingBox.d.ts +21 -21
- package/dist/utilities/CfgBoundingBox.js +81 -81
- package/dist/utilities/anchor/anchor.d.ts +50 -50
- package/dist/utilities/anchor/anchor.js +133 -133
- package/dist/utilities/anchor/anchorMap.d.ts +20 -20
- package/dist/utilities/anchor/anchorMap.js +111 -111
- package/dist/utilities/utilities3D.d.ts +70 -70
- package/dist/utilities/utilities3D.js +265 -265
- package/dist/utilities/utilitiesColor.d.ts +18 -18
- package/dist/utilities/utilitiesColor.js +50 -50
- package/dist/utilities/utilitiesImage.d.ts +6 -6
- package/dist/utilities/utilitiesImage.js +107 -107
- package/dist/utilities/utilitiesSymRootIdentifier.d.ts +7 -7
- package/dist/utilities/utilitiesSymRootIdentifier.js +26 -26
- package/dist/view/BaseView.d.ts +78 -78
- package/dist/view/BaseView.js +303 -303
- package/dist/view/BaseViewConfiguration.d.ts +32 -32
- package/dist/view/BaseViewConfiguration.js +10 -10
- package/dist/view/RenderEnv.d.ts +43 -43
- package/dist/view/RenderEnv.js +7 -7
- package/dist/view/SingleProductDefaultCameraView.d.ts +38 -38
- package/dist/view/SingleProductDefaultCameraView.js +149 -149
- package/dist/view/SingleProductDefaultCameraViewConfiguration.d.ts +44 -44
- package/dist/view/SingleProductDefaultCameraViewConfiguration.js +11 -11
- package/dist/view/SingleProductView.d.ts +44 -44
- package/dist/view/SingleProductView.js +212 -212
- package/dist/view/SingleProductViewConfiguration.d.ts +32 -32
- package/dist/view/SingleProductViewConfiguration.js +19 -19
- package/package.json +5 -5
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
export const EasingFunctions = {
|
|
2
|
-
// no easing, no acceleration
|
|
3
|
-
linear: ((t) => t),
|
|
4
|
-
// accelerating from zero velocity
|
|
5
|
-
easeInQuad: ((t) => t * t),
|
|
6
|
-
// decelerating to zero velocity
|
|
7
|
-
easeOutQuad: ((t) => t * (2 - t)),
|
|
8
|
-
// acceleration until halfway, then deceleration
|
|
9
|
-
easeInOutQuad: ((t) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t)),
|
|
10
|
-
// accelerating from zero velocity
|
|
11
|
-
easeInCubic: ((t) => t * t * t),
|
|
12
|
-
// decelerating to zero velocity
|
|
13
|
-
easeOutCubic: ((t) => --t * t * t + 1),
|
|
14
|
-
// acceleration until halfway, then deceleration
|
|
15
|
-
easeInOutCubic: ((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),
|
|
16
|
-
// accelerating from zero velocity
|
|
17
|
-
easeInQuart: ((t) => t * t * t * t),
|
|
18
|
-
// decelerating to zero velocity
|
|
19
|
-
easeOutQuart: ((t) => 1 - --t * t * t * t),
|
|
20
|
-
// acceleration until halfway, then deceleration
|
|
21
|
-
easeInOutQuart: ((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t),
|
|
22
|
-
// accelerating from zero velocity
|
|
23
|
-
easeInQuint: ((t) => t * t * t * t * t),
|
|
24
|
-
// decelerating to zero velocity
|
|
25
|
-
easeOutQuint: ((t) => 1 + --t * t * t * t * t),
|
|
26
|
-
// acceleration until halfway, then deceleration
|
|
27
|
-
easeInOutQuint: ((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t),
|
|
28
|
-
sinBounce: (oscillations) => (t) => (1 - Math.cos(t * oscillations * Math.PI * 2)) / 2,
|
|
29
|
-
easeInSine: ((t) => -Math.cos(t * (Math.PI / 2)) + 1),
|
|
30
|
-
easeOutSine: ((t) => Math.sin(t * (Math.PI / 2))),
|
|
31
|
-
easeInOutSine: ((t) => (-1 / 2) * (Math.cos(Math.PI * t) - 1)),
|
|
32
|
-
easeInExpo: ((t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1)))),
|
|
33
|
-
easeOutExpo: ((t) => (t === 1 ? 1 : -Math.pow(2, -10 * t) + 1)),
|
|
34
|
-
easeInOutExpo: ((t) => {
|
|
35
|
-
if (t === 0)
|
|
36
|
-
return 0;
|
|
37
|
-
if (t === 1)
|
|
38
|
-
return 1;
|
|
39
|
-
if ((t /= 1 / 2) < 1)
|
|
40
|
-
return (1 / 2) * Math.pow(2, 10 * (t - 1));
|
|
41
|
-
return (1 / 2) * (-Math.pow(2, -10 * --t) + 2);
|
|
42
|
-
}),
|
|
43
|
-
easeInCirc: ((t) => -(Math.sqrt(1 - t * t) - 1)),
|
|
44
|
-
easeOutCirc: ((t) => Math.sqrt(1 - (t = t - 1) * t)),
|
|
45
|
-
easeInOutCirc: ((t) => {
|
|
46
|
-
if (t / 1 / 2 < 1)
|
|
47
|
-
return (-1 / 2) * (Math.sqrt(1 - t * t) - 1);
|
|
48
|
-
return (1 / 2) * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
|
49
|
-
}),
|
|
50
|
-
easeInElastic: ((t) => {
|
|
51
|
-
let s = 1.70158;
|
|
52
|
-
let p = 0;
|
|
53
|
-
let a = 1;
|
|
54
|
-
if (t === 0)
|
|
55
|
-
return 0;
|
|
56
|
-
if (t === 1)
|
|
57
|
-
return 1;
|
|
58
|
-
if (!p)
|
|
59
|
-
p = 0.3;
|
|
60
|
-
if (a < Math.abs(1)) {
|
|
61
|
-
a = 1;
|
|
62
|
-
s = p / 4;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
66
|
-
}
|
|
67
|
-
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p));
|
|
68
|
-
}),
|
|
69
|
-
easeOutElastic: ((t) => {
|
|
70
|
-
let s = 1.70158;
|
|
71
|
-
let p = 0;
|
|
72
|
-
let a = 1;
|
|
73
|
-
if (t === 0)
|
|
74
|
-
return 0;
|
|
75
|
-
if (t === 1)
|
|
76
|
-
return 1;
|
|
77
|
-
if (!p)
|
|
78
|
-
p = 0.3;
|
|
79
|
-
if (a < Math.abs(1)) {
|
|
80
|
-
a = 1;
|
|
81
|
-
s = p / 4;
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
85
|
-
}
|
|
86
|
-
return a * Math.pow(2, -10 * t) * Math.sin(((t - s) * (2 * Math.PI)) / p) + 1;
|
|
87
|
-
}),
|
|
88
|
-
easeInOutElastic: ((t) => {
|
|
89
|
-
let s = 1.70158;
|
|
90
|
-
let p = 0;
|
|
91
|
-
let a = 1;
|
|
92
|
-
if (t === 0)
|
|
93
|
-
return 0;
|
|
94
|
-
if (t / 2 === 2)
|
|
95
|
-
return 1;
|
|
96
|
-
if (!p)
|
|
97
|
-
p = 0.3 * 1.5;
|
|
98
|
-
if (a < 1) {
|
|
99
|
-
a = 1;
|
|
100
|
-
s = p / 4;
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
104
|
-
}
|
|
105
|
-
if (t < 1)
|
|
106
|
-
return (-0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p)));
|
|
107
|
-
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p) * 0.5 + 1;
|
|
108
|
-
}),
|
|
109
|
-
easeInBack: (s = 1.70158) => (t) => t * t * ((s + 1) * t - s),
|
|
110
|
-
easeOutBack: (s = 1.70158) => (t) => (t = t - 1) * t * ((s + 1) * t + s) + 1,
|
|
111
|
-
easeInOutBack: (s = 1.70158) => (t) => {
|
|
112
|
-
if ((t /= 1 / 2) < 1)
|
|
113
|
-
return (1 / 2) * (t * t * (((s *= 1.525) + 1) * t - s));
|
|
114
|
-
return (1 / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);
|
|
115
|
-
},
|
|
116
|
-
easeOutBounce: ((t) => {
|
|
117
|
-
if (t < 1 / 2.75) {
|
|
118
|
-
return 7.5625 * t * t;
|
|
119
|
-
}
|
|
120
|
-
else if (t < 2 / 2.75) {
|
|
121
|
-
return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
|
|
122
|
-
}
|
|
123
|
-
else if (t < 2.5 / 2.75) {
|
|
124
|
-
return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
|
|
128
|
-
}
|
|
129
|
-
}),
|
|
130
|
-
makeMirrored: (func) => (t) => {
|
|
131
|
-
const perceivedT = (t < 0.5 ? t : 1 - t) * 2;
|
|
132
|
-
return func(perceivedT);
|
|
133
|
-
},
|
|
134
|
-
invert: (func) => (t) => {
|
|
135
|
-
return func(1 - t);
|
|
136
|
-
},
|
|
137
|
-
};
|
|
1
|
+
export const EasingFunctions = {
|
|
2
|
+
// no easing, no acceleration
|
|
3
|
+
linear: ((t) => t),
|
|
4
|
+
// accelerating from zero velocity
|
|
5
|
+
easeInQuad: ((t) => t * t),
|
|
6
|
+
// decelerating to zero velocity
|
|
7
|
+
easeOutQuad: ((t) => t * (2 - t)),
|
|
8
|
+
// acceleration until halfway, then deceleration
|
|
9
|
+
easeInOutQuad: ((t) => (t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t)),
|
|
10
|
+
// accelerating from zero velocity
|
|
11
|
+
easeInCubic: ((t) => t * t * t),
|
|
12
|
+
// decelerating to zero velocity
|
|
13
|
+
easeOutCubic: ((t) => --t * t * t + 1),
|
|
14
|
+
// acceleration until halfway, then deceleration
|
|
15
|
+
easeInOutCubic: ((t) => t < 0.5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1),
|
|
16
|
+
// accelerating from zero velocity
|
|
17
|
+
easeInQuart: ((t) => t * t * t * t),
|
|
18
|
+
// decelerating to zero velocity
|
|
19
|
+
easeOutQuart: ((t) => 1 - --t * t * t * t),
|
|
20
|
+
// acceleration until halfway, then deceleration
|
|
21
|
+
easeInOutQuart: ((t) => t < 0.5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t),
|
|
22
|
+
// accelerating from zero velocity
|
|
23
|
+
easeInQuint: ((t) => t * t * t * t * t),
|
|
24
|
+
// decelerating to zero velocity
|
|
25
|
+
easeOutQuint: ((t) => 1 + --t * t * t * t * t),
|
|
26
|
+
// acceleration until halfway, then deceleration
|
|
27
|
+
easeInOutQuint: ((t) => t < 0.5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t),
|
|
28
|
+
sinBounce: (oscillations) => (t) => (1 - Math.cos(t * oscillations * Math.PI * 2)) / 2,
|
|
29
|
+
easeInSine: ((t) => -Math.cos(t * (Math.PI / 2)) + 1),
|
|
30
|
+
easeOutSine: ((t) => Math.sin(t * (Math.PI / 2))),
|
|
31
|
+
easeInOutSine: ((t) => (-1 / 2) * (Math.cos(Math.PI * t) - 1)),
|
|
32
|
+
easeInExpo: ((t) => (t === 0 ? 0 : Math.pow(2, 10 * (t - 1)))),
|
|
33
|
+
easeOutExpo: ((t) => (t === 1 ? 1 : -Math.pow(2, -10 * t) + 1)),
|
|
34
|
+
easeInOutExpo: ((t) => {
|
|
35
|
+
if (t === 0)
|
|
36
|
+
return 0;
|
|
37
|
+
if (t === 1)
|
|
38
|
+
return 1;
|
|
39
|
+
if ((t /= 1 / 2) < 1)
|
|
40
|
+
return (1 / 2) * Math.pow(2, 10 * (t - 1));
|
|
41
|
+
return (1 / 2) * (-Math.pow(2, -10 * --t) + 2);
|
|
42
|
+
}),
|
|
43
|
+
easeInCirc: ((t) => -(Math.sqrt(1 - t * t) - 1)),
|
|
44
|
+
easeOutCirc: ((t) => Math.sqrt(1 - (t = t - 1) * t)),
|
|
45
|
+
easeInOutCirc: ((t) => {
|
|
46
|
+
if (t / 1 / 2 < 1)
|
|
47
|
+
return (-1 / 2) * (Math.sqrt(1 - t * t) - 1);
|
|
48
|
+
return (1 / 2) * (Math.sqrt(1 - (t -= 2) * t) + 1);
|
|
49
|
+
}),
|
|
50
|
+
easeInElastic: ((t) => {
|
|
51
|
+
let s = 1.70158;
|
|
52
|
+
let p = 0;
|
|
53
|
+
let a = 1;
|
|
54
|
+
if (t === 0)
|
|
55
|
+
return 0;
|
|
56
|
+
if (t === 1)
|
|
57
|
+
return 1;
|
|
58
|
+
if (!p)
|
|
59
|
+
p = 0.3;
|
|
60
|
+
if (a < Math.abs(1)) {
|
|
61
|
+
a = 1;
|
|
62
|
+
s = p / 4;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
66
|
+
}
|
|
67
|
+
return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p));
|
|
68
|
+
}),
|
|
69
|
+
easeOutElastic: ((t) => {
|
|
70
|
+
let s = 1.70158;
|
|
71
|
+
let p = 0;
|
|
72
|
+
let a = 1;
|
|
73
|
+
if (t === 0)
|
|
74
|
+
return 0;
|
|
75
|
+
if (t === 1)
|
|
76
|
+
return 1;
|
|
77
|
+
if (!p)
|
|
78
|
+
p = 0.3;
|
|
79
|
+
if (a < Math.abs(1)) {
|
|
80
|
+
a = 1;
|
|
81
|
+
s = p / 4;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
85
|
+
}
|
|
86
|
+
return a * Math.pow(2, -10 * t) * Math.sin(((t - s) * (2 * Math.PI)) / p) + 1;
|
|
87
|
+
}),
|
|
88
|
+
easeInOutElastic: ((t) => {
|
|
89
|
+
let s = 1.70158;
|
|
90
|
+
let p = 0;
|
|
91
|
+
let a = 1;
|
|
92
|
+
if (t === 0)
|
|
93
|
+
return 0;
|
|
94
|
+
if (t / 2 === 2)
|
|
95
|
+
return 1;
|
|
96
|
+
if (!p)
|
|
97
|
+
p = 0.3 * 1.5;
|
|
98
|
+
if (a < 1) {
|
|
99
|
+
a = 1;
|
|
100
|
+
s = p / 4;
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
s = (p / (2 * Math.PI)) * Math.asin(1 / a);
|
|
104
|
+
}
|
|
105
|
+
if (t < 1)
|
|
106
|
+
return (-0.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p)));
|
|
107
|
+
return a * Math.pow(2, -10 * (t -= 1)) * Math.sin(((t - s) * (2 * Math.PI)) / p) * 0.5 + 1;
|
|
108
|
+
}),
|
|
109
|
+
easeInBack: (s = 1.70158) => (t) => t * t * ((s + 1) * t - s),
|
|
110
|
+
easeOutBack: (s = 1.70158) => (t) => (t = t - 1) * t * ((s + 1) * t + s) + 1,
|
|
111
|
+
easeInOutBack: (s = 1.70158) => (t) => {
|
|
112
|
+
if ((t /= 1 / 2) < 1)
|
|
113
|
+
return (1 / 2) * (t * t * (((s *= 1.525) + 1) * t - s));
|
|
114
|
+
return (1 / 2) * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2);
|
|
115
|
+
},
|
|
116
|
+
easeOutBounce: ((t) => {
|
|
117
|
+
if (t < 1 / 2.75) {
|
|
118
|
+
return 7.5625 * t * t;
|
|
119
|
+
}
|
|
120
|
+
else if (t < 2 / 2.75) {
|
|
121
|
+
return 7.5625 * (t -= 1.5 / 2.75) * t + 0.75;
|
|
122
|
+
}
|
|
123
|
+
else if (t < 2.5 / 2.75) {
|
|
124
|
+
return 7.5625 * (t -= 2.25 / 2.75) * t + 0.9375;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
return 7.5625 * (t -= 2.625 / 2.75) * t + 0.984375;
|
|
128
|
+
}
|
|
129
|
+
}),
|
|
130
|
+
makeMirrored: (func) => (t) => {
|
|
131
|
+
const perceivedT = (t < 0.5 ? t : 1 - t) * 2;
|
|
132
|
+
return func(perceivedT);
|
|
133
|
+
},
|
|
134
|
+
invert: (func) => (t) => {
|
|
135
|
+
return func(1 - t);
|
|
136
|
+
},
|
|
137
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import { Observable } from "@configura/web-utilities";
|
|
2
|
-
import { CfgDeferredMeshNode } from "../../nodes/CfgDeferredMeshNode.js";
|
|
3
|
-
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
4
|
-
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
5
|
-
import { SingleProductView } from "../../view/SingleProductView.js";
|
|
6
|
-
import { SingleProductViewPhaseEvent } from "../../view/SingleProductViewConfiguration.js";
|
|
7
|
-
export declare type CoordinatorCreator = (view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>) => Coordinator;
|
|
8
|
-
export declare type CoordinatorWithMeta = {
|
|
9
|
-
coordinator: Coordinator;
|
|
10
|
-
isNewProduct: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare type CoordinatorConfig = Record<string, unknown>;
|
|
13
|
-
export declare const defaultConfig: CoordinatorConfig;
|
|
14
|
-
export declare abstract class Coordinator<Config extends CoordinatorConfig = CoordinatorConfig> {
|
|
15
|
-
protected view: SingleProductView;
|
|
16
|
-
protected phaseObservable: Observable<SingleProductViewPhaseEvent>;
|
|
17
|
-
protected _config: Config;
|
|
18
|
-
constructor(view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>, _config: Config);
|
|
19
|
-
private phaseListener;
|
|
20
|
-
destroy(): void;
|
|
21
|
-
protected productNode: CfgProductNode | undefined;
|
|
22
|
-
protected setProduct(productNode: CfgProductNode): void;
|
|
23
|
-
prepareForEnter(_node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
|
|
24
|
-
prepareForExit(_node: CfgSymRootNode): Promise<void>;
|
|
25
|
-
prepareForMaterialChange(_node: CfgDeferredMeshNode, _isNewProduct: boolean): Promise<void>;
|
|
26
|
-
abstract willTick(now: number, delta: number): boolean;
|
|
27
|
-
abstract tick(now: number, delta: number): void;
|
|
28
|
-
}
|
|
1
|
+
import { Observable } from "@configura/web-utilities";
|
|
2
|
+
import { CfgDeferredMeshNode } from "../../nodes/CfgDeferredMeshNode.js";
|
|
3
|
+
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
4
|
+
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
5
|
+
import { SingleProductView } from "../../view/SingleProductView.js";
|
|
6
|
+
import { SingleProductViewPhaseEvent } from "../../view/SingleProductViewConfiguration.js";
|
|
7
|
+
export declare type CoordinatorCreator = (view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>) => Coordinator;
|
|
8
|
+
export declare type CoordinatorWithMeta = {
|
|
9
|
+
coordinator: Coordinator;
|
|
10
|
+
isNewProduct: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type CoordinatorConfig = Record<string, unknown>;
|
|
13
|
+
export declare const defaultConfig: CoordinatorConfig;
|
|
14
|
+
export declare abstract class Coordinator<Config extends CoordinatorConfig = CoordinatorConfig> {
|
|
15
|
+
protected view: SingleProductView;
|
|
16
|
+
protected phaseObservable: Observable<SingleProductViewPhaseEvent>;
|
|
17
|
+
protected _config: Config;
|
|
18
|
+
constructor(view: SingleProductView, phaseObservable: Observable<SingleProductViewPhaseEvent>, _config: Config);
|
|
19
|
+
private phaseListener;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
protected productNode: CfgProductNode | undefined;
|
|
22
|
+
protected setProduct(productNode: CfgProductNode): void;
|
|
23
|
+
prepareForEnter(_node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
|
|
24
|
+
prepareForExit(_node: CfgSymRootNode): Promise<void>;
|
|
25
|
+
prepareForMaterialChange(_node: CfgDeferredMeshNode, _isNewProduct: boolean): Promise<void>;
|
|
26
|
+
abstract willTick(now: number, delta: number): boolean;
|
|
27
|
+
abstract tick(now: number, delta: number): void;
|
|
28
|
+
}
|
|
29
29
|
//# sourceMappingURL=Coordinator.d.ts.map
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { SingleProductViewPhase, } from "../../view/SingleProductViewConfiguration.js";
|
|
11
|
-
export const defaultConfig = {};
|
|
12
|
-
export class Coordinator {
|
|
13
|
-
constructor(view, phaseObservable, _config) {
|
|
14
|
-
this.view = view;
|
|
15
|
-
this.phaseObservable = phaseObservable;
|
|
16
|
-
this._config = _config;
|
|
17
|
-
this.phaseListener = (phase) => {
|
|
18
|
-
const { previous, current } = phase;
|
|
19
|
-
if (previous !== SingleProductViewPhase.AddNewProduct ||
|
|
20
|
-
current === SingleProductViewPhase.Error ||
|
|
21
|
-
current === SingleProductViewPhase.Aborted) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
const currentProductNode = this.view.currentProductNode;
|
|
25
|
-
if (currentProductNode === undefined) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this.setProduct(currentProductNode);
|
|
29
|
-
};
|
|
30
|
-
this.phaseObservable.listen(this.phaseListener);
|
|
31
|
-
}
|
|
32
|
-
destroy() {
|
|
33
|
-
this.phaseObservable.stopListen(this.phaseListener);
|
|
34
|
-
}
|
|
35
|
-
setProduct(productNode) {
|
|
36
|
-
this.productNode = productNode;
|
|
37
|
-
}
|
|
38
|
-
prepareForEnter(_node, _isNewProduct) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
// Do nothing
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
prepareForExit(_node) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
// Do nothing
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
prepareForMaterialChange(_node, _isNewProduct) {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
// Do nothing
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { SingleProductViewPhase, } from "../../view/SingleProductViewConfiguration.js";
|
|
11
|
+
export const defaultConfig = {};
|
|
12
|
+
export class Coordinator {
|
|
13
|
+
constructor(view, phaseObservable, _config) {
|
|
14
|
+
this.view = view;
|
|
15
|
+
this.phaseObservable = phaseObservable;
|
|
16
|
+
this._config = _config;
|
|
17
|
+
this.phaseListener = (phase) => {
|
|
18
|
+
const { previous, current } = phase;
|
|
19
|
+
if (previous !== SingleProductViewPhase.AddNewProduct ||
|
|
20
|
+
current === SingleProductViewPhase.Error ||
|
|
21
|
+
current === SingleProductViewPhase.Aborted) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const currentProductNode = this.view.currentProductNode;
|
|
25
|
+
if (currentProductNode === undefined) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
this.setProduct(currentProductNode);
|
|
29
|
+
};
|
|
30
|
+
this.phaseObservable.listen(this.phaseListener);
|
|
31
|
+
}
|
|
32
|
+
destroy() {
|
|
33
|
+
this.phaseObservable.stopListen(this.phaseListener);
|
|
34
|
+
}
|
|
35
|
+
setProduct(productNode) {
|
|
36
|
+
this.productNode = productNode;
|
|
37
|
+
}
|
|
38
|
+
prepareForEnter(_node, _isNewProduct) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
// Do nothing
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
prepareForExit(_node) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
// Do nothing
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
prepareForMaterialChange(_node, _isNewProduct) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
// Do nothing
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
2
|
-
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
3
|
-
import { CoordinatorCreator } from "./Coordinator.js";
|
|
4
|
-
import { CoordinatorNodeQueues, CoordinatorNodeQueuesConfig } from "./CoordinatorNodeQueues.js";
|
|
5
|
-
export declare type CoordinatorDropAndSpinConfig = CoordinatorNodeQueuesConfig & {
|
|
6
|
-
distance: number;
|
|
7
|
-
enterDuration: number;
|
|
8
|
-
exitDuration: number;
|
|
9
|
-
staggerDuration: number;
|
|
10
|
-
spinDuration: number;
|
|
11
|
-
};
|
|
12
|
-
export declare const defaultConfig: CoordinatorDropAndSpinConfig;
|
|
13
|
-
export declare class CoordinatorDropAndSpin extends CoordinatorNodeQueues<CoordinatorDropAndSpinConfig> {
|
|
14
|
-
static getCoordinatorCreator(config?: Partial<CoordinatorDropAndSpinConfig>): CoordinatorCreator;
|
|
15
|
-
private constructor();
|
|
16
|
-
destroy(): void;
|
|
17
|
-
private phaseListenerDropAndSpin;
|
|
18
|
-
setProduct(productNode: CfgProductNode): void;
|
|
19
|
-
prepareForEnter(node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
|
|
20
|
-
prepareForExit(node: CfgSymRootNode): Promise<void>;
|
|
21
|
-
private applyDelay;
|
|
22
|
-
}
|
|
1
|
+
import { CfgProductNode } from "../../nodes/CfgProductNode.js";
|
|
2
|
+
import { CfgSymRootNode } from "../../nodes/CfgSymRootNode.js";
|
|
3
|
+
import { CoordinatorCreator } from "./Coordinator.js";
|
|
4
|
+
import { CoordinatorNodeQueues, CoordinatorNodeQueuesConfig } from "./CoordinatorNodeQueues.js";
|
|
5
|
+
export declare type CoordinatorDropAndSpinConfig = CoordinatorNodeQueuesConfig & {
|
|
6
|
+
distance: number;
|
|
7
|
+
enterDuration: number;
|
|
8
|
+
exitDuration: number;
|
|
9
|
+
staggerDuration: number;
|
|
10
|
+
spinDuration: number;
|
|
11
|
+
};
|
|
12
|
+
export declare const defaultConfig: CoordinatorDropAndSpinConfig;
|
|
13
|
+
export declare class CoordinatorDropAndSpin extends CoordinatorNodeQueues<CoordinatorDropAndSpinConfig> {
|
|
14
|
+
static getCoordinatorCreator(config?: Partial<CoordinatorDropAndSpinConfig>): CoordinatorCreator;
|
|
15
|
+
private constructor();
|
|
16
|
+
destroy(): void;
|
|
17
|
+
private phaseListenerDropAndSpin;
|
|
18
|
+
setProduct(productNode: CfgProductNode): void;
|
|
19
|
+
prepareForEnter(node: CfgSymRootNode, _isNewProduct: boolean): Promise<void>;
|
|
20
|
+
prepareForExit(node: CfgSymRootNode): Promise<void>;
|
|
21
|
+
private applyDelay;
|
|
22
|
+
}
|
|
23
23
|
//# sourceMappingURL=CoordinatorDropAndSpin.d.ts.map
|