@vived/app 4.8.2 → 4.8.4
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/lib/Components/SceneRoot/UC/CenterSceneRootOnPixelPick.js +2 -3
- package/lib/Components/SceneRoot/UC/FocusOnPixel.js +2 -3
- package/lib/Components/StoredView/UC/RestoreStoredViewUC.js +2 -3
- package/lib/Components/Transform3D/UC/StickTransformUC.js +2 -1
- package/lib/Utilities/easeFunctions.d.ts +23 -19
- package/lib/Utilities/easeFunctions.js +68 -39
- package/package.json +1 -1
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.centerOnPixel = exports.makeCenterSceneRootOnPixelPickUC = exports.CenterSceneRootOnPixelPickUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
|
|
6
|
+
const Utilities_1 = require("../../../Utilities");
|
|
6
7
|
const Babylon_1 = require("../../Babylon");
|
|
7
8
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
8
9
|
const SceneRootEntity_1 = require("../Entities/SceneRootEntity");
|
|
@@ -19,9 +20,7 @@ class CenterSceneRootOnPixelPickImp extends CenterSceneRootOnPixelPickUC {
|
|
|
19
20
|
constructor(appObject) {
|
|
20
21
|
super(appObject, CenterSceneRootOnPixelPickUC.type);
|
|
21
22
|
this.durationMS = 500;
|
|
22
|
-
this.easeFn =
|
|
23
|
-
return val;
|
|
24
|
-
};
|
|
23
|
+
this.easeFn = Utilities_1.expoOut;
|
|
25
24
|
this.centerOnPixel = (pixel) => {
|
|
26
25
|
if (!this.sceneRoot)
|
|
27
26
|
return;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.makeFocusOnPixelUC = exports.FocusOnPixelUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
5
|
const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
|
|
6
|
+
const Utilities_1 = require("../../../Utilities");
|
|
6
7
|
const Babylon_1 = require("../../Babylon");
|
|
7
8
|
const Dispatcher_1 = require("../../Dispatcher");
|
|
8
9
|
const SceneRootEntity_1 = require("../Entities/SceneRootEntity");
|
|
@@ -19,9 +20,7 @@ class FocusOnPixelImp extends FocusOnPixelUC {
|
|
|
19
20
|
constructor(appObject) {
|
|
20
21
|
super(appObject, FocusOnPixelUC.type);
|
|
21
22
|
this.durationMS = 500;
|
|
22
|
-
this.easeFn =
|
|
23
|
-
return val;
|
|
24
|
-
};
|
|
23
|
+
this.easeFn = Utilities_1.expoOut;
|
|
25
24
|
this.centerOnPixel = (pixel) => {
|
|
26
25
|
if (!this.sceneRoot)
|
|
27
26
|
return;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.restoreStoredView = exports.makeRestoreStoredViewUC = exports.RestoreStoredViewUC = void 0;
|
|
4
4
|
const AppObject_1 = require("../../../AppObject");
|
|
5
|
+
const Utilities_1 = require("../../../Utilities");
|
|
5
6
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
7
|
const SceneRoot_1 = require("../../SceneRoot");
|
|
7
8
|
const Entities_1 = require("../Entities");
|
|
@@ -27,9 +28,7 @@ exports.restoreStoredView = restoreStoredView;
|
|
|
27
28
|
class RestoreStoredViewUCImp extends RestoreStoredViewUC {
|
|
28
29
|
constructor(appObject) {
|
|
29
30
|
super(appObject, RestoreStoredViewUC.type);
|
|
30
|
-
this.ease =
|
|
31
|
-
return val;
|
|
32
|
-
}; // Default to lineal
|
|
31
|
+
this.ease = Utilities_1.expoOut;
|
|
33
32
|
this.restoreStoredView = () => {
|
|
34
33
|
if (this.storedView && this.sceneRoot) {
|
|
35
34
|
if (!this.storedView.hasStoredView)
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeStickTransformUC = exports.StickTransformUC = void 0;
|
|
4
4
|
const AppObjectUC_1 = require("../../../AppObject/AppObjectUC");
|
|
5
|
+
const Utilities_1 = require("../../../Utilities");
|
|
5
6
|
const ValueObjects_1 = require("../../../ValueObjects");
|
|
6
7
|
const Transform3D_1 = require("../Entities/Transform3D");
|
|
7
8
|
/* TODO
|
|
@@ -24,7 +25,7 @@ class StickTransformUCImp extends StickTransformUC {
|
|
|
24
25
|
constructor(appObject) {
|
|
25
26
|
super(appObject, StickTransformUC.type);
|
|
26
27
|
this.stickDurationMS = 500;
|
|
27
|
-
this.easeFn =
|
|
28
|
+
this.easeFn = Utilities_1.expoOut;
|
|
28
29
|
this.dispose = () => {
|
|
29
30
|
var _a;
|
|
30
31
|
super.dispose();
|
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
export declare
|
|
10
|
-
export declare
|
|
11
|
-
export declare
|
|
12
|
-
export declare
|
|
13
|
-
export declare
|
|
14
|
-
export declare
|
|
15
|
-
export declare
|
|
16
|
-
export declare
|
|
17
|
-
export declare
|
|
18
|
-
export declare
|
|
19
|
-
export declare
|
|
1
|
+
import { EaseFn } from "../Types";
|
|
2
|
+
export declare const easeLinear: EaseFn;
|
|
3
|
+
export declare const quadIn: EaseFn;
|
|
4
|
+
export declare const quadOut: EaseFn;
|
|
5
|
+
export declare const quadInOut: EaseFn;
|
|
6
|
+
export declare const cubicIn: EaseFn;
|
|
7
|
+
export declare const cubicOut: EaseFn;
|
|
8
|
+
export declare const cubicInOut: EaseFn;
|
|
9
|
+
export declare const expoIn: EaseFn;
|
|
10
|
+
export declare const expoOut: EaseFn;
|
|
11
|
+
export declare const expoInOut: EaseFn;
|
|
12
|
+
export declare const sinIn: EaseFn;
|
|
13
|
+
export declare const sinOut: EaseFn;
|
|
14
|
+
export declare const sinInOut: EaseFn;
|
|
15
|
+
export declare const quartIn: EaseFn;
|
|
16
|
+
export declare const quartOut: EaseFn;
|
|
17
|
+
export declare const quartInOut: EaseFn;
|
|
18
|
+
export declare const quintIn: EaseFn;
|
|
19
|
+
export declare const quintOut: EaseFn;
|
|
20
|
+
export declare const quintInOut: EaseFn;
|
|
21
|
+
export declare const circIn: EaseFn;
|
|
22
|
+
export declare const circOut: EaseFn;
|
|
23
|
+
export declare const circInOut: EaseFn;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.quintInOut = exports.quintOut = exports.quintIn = exports.quartInOut = exports.quartOut = exports.quartIn = exports.sinInOut = exports.sinOut = exports.sinIn = exports.expoInOut = exports.expoOut = exports.expoIn = exports.cubicInOut = exports.cubicOut = exports.cubicIn = exports.quadInOut = exports.quadOut = exports.quadIn = exports.easeLinear = void 0;
|
|
4
|
-
|
|
3
|
+
exports.circInOut = exports.circOut = exports.circIn = exports.quintInOut = exports.quintOut = exports.quintIn = exports.quartInOut = exports.quartOut = exports.quartIn = exports.sinInOut = exports.sinOut = exports.sinIn = exports.expoInOut = exports.expoOut = exports.expoIn = exports.cubicInOut = exports.cubicOut = exports.cubicIn = exports.quadInOut = exports.quadOut = exports.quadIn = exports.easeLinear = void 0;
|
|
4
|
+
const easeLinear = (x) => {
|
|
5
5
|
if (x <= 0)
|
|
6
6
|
return 0;
|
|
7
7
|
if (x >= 1)
|
|
8
8
|
return 1;
|
|
9
9
|
return x;
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
11
|
exports.easeLinear = easeLinear;
|
|
12
|
-
|
|
12
|
+
const quadIn = (x) => {
|
|
13
13
|
if (x <= 0)
|
|
14
14
|
return 0;
|
|
15
15
|
if (x >= 1)
|
|
16
16
|
return 1;
|
|
17
17
|
return x * x;
|
|
18
|
-
}
|
|
18
|
+
};
|
|
19
19
|
exports.quadIn = quadIn;
|
|
20
|
-
|
|
20
|
+
const quadOut = (x) => {
|
|
21
21
|
if (x <= 0)
|
|
22
22
|
return 0;
|
|
23
23
|
if (x >= 1)
|
|
24
24
|
return 1;
|
|
25
25
|
return x * (2 - x);
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
27
|
exports.quadOut = quadOut;
|
|
28
|
-
|
|
28
|
+
const quadInOut = (x) => {
|
|
29
29
|
if (x <= 0)
|
|
30
30
|
return 0;
|
|
31
31
|
if (x >= 1)
|
|
@@ -36,25 +36,25 @@ function quadInOut(x) {
|
|
|
36
36
|
else {
|
|
37
37
|
return 1 - Math.pow(-2 * x + 2, 2) / 2;
|
|
38
38
|
}
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
exports.quadInOut = quadInOut;
|
|
41
|
-
|
|
41
|
+
const cubicIn = (x) => {
|
|
42
42
|
if (x <= 0)
|
|
43
43
|
return 0;
|
|
44
44
|
if (x >= 1)
|
|
45
45
|
return 1;
|
|
46
46
|
return x * x * x;
|
|
47
|
-
}
|
|
47
|
+
};
|
|
48
48
|
exports.cubicIn = cubicIn;
|
|
49
|
-
|
|
49
|
+
const cubicOut = (x) => {
|
|
50
50
|
if (x <= 0)
|
|
51
51
|
return 0;
|
|
52
52
|
if (x >= 1)
|
|
53
53
|
return 1;
|
|
54
54
|
return --x * x * x + 1;
|
|
55
|
-
}
|
|
55
|
+
};
|
|
56
56
|
exports.cubicOut = cubicOut;
|
|
57
|
-
|
|
57
|
+
const cubicInOut = (x) => {
|
|
58
58
|
if (x <= 0)
|
|
59
59
|
return 0;
|
|
60
60
|
if (x >= 1)
|
|
@@ -66,25 +66,25 @@ function cubicInOut(x) {
|
|
|
66
66
|
else {
|
|
67
67
|
return ((x -= 2) * x * x + 2) / 2;
|
|
68
68
|
}
|
|
69
|
-
}
|
|
69
|
+
};
|
|
70
70
|
exports.cubicInOut = cubicInOut;
|
|
71
|
-
|
|
71
|
+
const expoIn = (x) => {
|
|
72
72
|
if (x <= 0)
|
|
73
73
|
return 0;
|
|
74
74
|
if (x >= 1)
|
|
75
75
|
return 1;
|
|
76
76
|
return Math.pow(2, 10 * x - 10);
|
|
77
|
-
}
|
|
77
|
+
};
|
|
78
78
|
exports.expoIn = expoIn;
|
|
79
|
-
|
|
79
|
+
const expoOut = (x) => {
|
|
80
80
|
if (x <= 0)
|
|
81
81
|
return 0;
|
|
82
82
|
if (x >= 1)
|
|
83
83
|
return 1;
|
|
84
84
|
return 1 - Math.pow(2, -10 * x);
|
|
85
|
-
}
|
|
85
|
+
};
|
|
86
86
|
exports.expoOut = expoOut;
|
|
87
|
-
|
|
87
|
+
const expoInOut = (x) => {
|
|
88
88
|
if (x <= 0)
|
|
89
89
|
return 0;
|
|
90
90
|
if (x >= 1)
|
|
@@ -92,49 +92,49 @@ function expoInOut(x) {
|
|
|
92
92
|
return x < 0.5
|
|
93
93
|
? Math.pow(2, 20 * x - 10) / 2
|
|
94
94
|
: (2 - Math.pow(2, -20 * x + 10)) / 2;
|
|
95
|
-
}
|
|
95
|
+
};
|
|
96
96
|
exports.expoInOut = expoInOut;
|
|
97
|
-
|
|
97
|
+
const sinIn = (x) => {
|
|
98
98
|
if (x <= 0)
|
|
99
99
|
return 0;
|
|
100
100
|
if (x >= 1)
|
|
101
101
|
return 1;
|
|
102
102
|
return 1 - Math.cos((x * Math.PI) / 2);
|
|
103
|
-
}
|
|
103
|
+
};
|
|
104
104
|
exports.sinIn = sinIn;
|
|
105
|
-
|
|
105
|
+
const sinOut = (x) => {
|
|
106
106
|
if (x <= 0)
|
|
107
107
|
return 0;
|
|
108
108
|
if (x >= 1)
|
|
109
109
|
return 1;
|
|
110
110
|
return Math.sin((x * Math.PI) / 2);
|
|
111
|
-
}
|
|
111
|
+
};
|
|
112
112
|
exports.sinOut = sinOut;
|
|
113
|
-
|
|
113
|
+
const sinInOut = (x) => {
|
|
114
114
|
if (x <= 0)
|
|
115
115
|
return 0;
|
|
116
116
|
if (x >= 1)
|
|
117
117
|
return 1;
|
|
118
118
|
return -(Math.cos(Math.PI * x) - 1) / 2;
|
|
119
|
-
}
|
|
119
|
+
};
|
|
120
120
|
exports.sinInOut = sinInOut;
|
|
121
|
-
|
|
121
|
+
const quartIn = (x) => {
|
|
122
122
|
if (x <= 0)
|
|
123
123
|
return 0;
|
|
124
124
|
if (x >= 1)
|
|
125
125
|
return 1;
|
|
126
126
|
return x * x * x * x;
|
|
127
|
-
}
|
|
127
|
+
};
|
|
128
128
|
exports.quartIn = quartIn;
|
|
129
|
-
|
|
129
|
+
const quartOut = (x) => {
|
|
130
130
|
if (x <= 0)
|
|
131
131
|
return 0;
|
|
132
132
|
if (x >= 1)
|
|
133
133
|
return 1;
|
|
134
134
|
return 1 - Math.pow(1 - x, 4);
|
|
135
|
-
}
|
|
135
|
+
};
|
|
136
136
|
exports.quartOut = quartOut;
|
|
137
|
-
|
|
137
|
+
const quartInOut = (x) => {
|
|
138
138
|
if (x <= 0)
|
|
139
139
|
return 0;
|
|
140
140
|
if (x >= 1)
|
|
@@ -145,25 +145,25 @@ function quartInOut(x) {
|
|
|
145
145
|
else {
|
|
146
146
|
return 1 - Math.pow(-2 * x + 2, 4) / 2;
|
|
147
147
|
}
|
|
148
|
-
}
|
|
148
|
+
};
|
|
149
149
|
exports.quartInOut = quartInOut;
|
|
150
|
-
|
|
150
|
+
const quintIn = (x) => {
|
|
151
151
|
if (x <= 0)
|
|
152
152
|
return 0;
|
|
153
153
|
if (x >= 1)
|
|
154
154
|
return 1;
|
|
155
155
|
return x * x * x * x * x;
|
|
156
|
-
}
|
|
156
|
+
};
|
|
157
157
|
exports.quintIn = quintIn;
|
|
158
|
-
|
|
158
|
+
const quintOut = (x) => {
|
|
159
159
|
if (x <= 0)
|
|
160
160
|
return 0;
|
|
161
161
|
if (x >= 1)
|
|
162
162
|
return 1;
|
|
163
163
|
return 1 - Math.pow(1 - x, 5);
|
|
164
|
-
}
|
|
164
|
+
};
|
|
165
165
|
exports.quintOut = quintOut;
|
|
166
|
-
|
|
166
|
+
const quintInOut = (x) => {
|
|
167
167
|
if (x <= 0)
|
|
168
168
|
return 0;
|
|
169
169
|
if (x >= 1)
|
|
@@ -174,5 +174,34 @@ function quintInOut(x) {
|
|
|
174
174
|
else {
|
|
175
175
|
return 1 - Math.pow(-2 * x + 2, 5) / 2;
|
|
176
176
|
}
|
|
177
|
-
}
|
|
177
|
+
};
|
|
178
178
|
exports.quintInOut = quintInOut;
|
|
179
|
+
const circIn = (x) => {
|
|
180
|
+
if (x <= 0)
|
|
181
|
+
return 0;
|
|
182
|
+
if (x >= 1)
|
|
183
|
+
return 1;
|
|
184
|
+
return 1 - Math.sqrt(1 - Math.pow(x, 2));
|
|
185
|
+
};
|
|
186
|
+
exports.circIn = circIn;
|
|
187
|
+
const circOut = (x) => {
|
|
188
|
+
if (x <= 0)
|
|
189
|
+
return 0;
|
|
190
|
+
if (x >= 1)
|
|
191
|
+
return 1;
|
|
192
|
+
return Math.sqrt(1 - Math.pow(x - 1, 2));
|
|
193
|
+
};
|
|
194
|
+
exports.circOut = circOut;
|
|
195
|
+
const circInOut = (x) => {
|
|
196
|
+
if (x <= 0)
|
|
197
|
+
return 0;
|
|
198
|
+
if (x >= 1)
|
|
199
|
+
return 1;
|
|
200
|
+
if (x < 0.5) {
|
|
201
|
+
return (1 - Math.sqrt(1 - Math.pow(2 * x, 2))) / 2;
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
return (Math.sqrt(1 - Math.pow(-2 * x + 2, 2)) + 1) / 2;
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
exports.circInOut = circInOut;
|