@flighthq/motionpath 0.5.1-next.903.f434bc2 → 0.5.1-next.905.5fbf787
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/README.md +2 -2
- package/package.json +5 -5
- package/src/motionPath.test.ts +26 -20
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/motionpath`. The `@f
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/motionpath@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/motionpath@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/motionpath)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/5fbf7874064c384307542d68b4dcb6a895ff0dcf/LICENSE.md)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/motionpath",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.905.5fbf787",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,10 +38,10 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/entity": "0.5.1-next.
|
|
42
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
43
|
-
"@flighthq/path": "0.5.1-next.
|
|
44
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/entity": "0.5.1-next.905.5fbf787",
|
|
42
|
+
"@flighthq/geometry": "0.5.1-next.905.5fbf787",
|
|
43
|
+
"@flighthq/path": "0.5.1-next.905.5fbf787",
|
|
44
|
+
"@flighthq/types": "0.5.1-next.905.5fbf787"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"typescript": "^5.3.0"
|
package/src/motionPath.test.ts
CHANGED
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
getMotionPathHeading,
|
|
8
8
|
getMotionPathPosition,
|
|
9
9
|
getMotionPathProgress,
|
|
10
|
+
initializeMotionPath,
|
|
10
11
|
setMotionPathDistance,
|
|
11
12
|
setMotionPathProgress,
|
|
12
13
|
updateMotionPath,
|
|
@@ -93,6 +94,12 @@ describe('getMotionPathProgress', () => {
|
|
|
93
94
|
});
|
|
94
95
|
});
|
|
95
96
|
|
|
97
|
+
describe('initializeMotionPath', () => {
|
|
98
|
+
it('is the construction initializer of createMotionPath', () => {
|
|
99
|
+
expect(typeof initializeMotionPath).toBe('function');
|
|
100
|
+
});
|
|
101
|
+
});
|
|
102
|
+
|
|
96
103
|
// A straight horizontal line from (0,0) to (100,0): arc length 100.
|
|
97
104
|
describe('setMotionPathDistance', () => {
|
|
98
105
|
it('seeks to an absolute arc-length distance', () => {
|
|
@@ -135,6 +142,25 @@ describe('setMotionPathProgress', () => {
|
|
|
135
142
|
});
|
|
136
143
|
});
|
|
137
144
|
|
|
145
|
+
// A straight horizontal line from (0,0) to (100,0): arc length 100.
|
|
146
|
+
function line(): Path {
|
|
147
|
+
const path = createPath();
|
|
148
|
+
appendPathMoveTo(path, 0, 0);
|
|
149
|
+
appendPathLineTo(path, 100, 0);
|
|
150
|
+
return path;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function corner(): Path {
|
|
154
|
+
const path = createPath();
|
|
155
|
+
appendPathMoveTo(path, 0, 0);
|
|
156
|
+
appendPathLineTo(path, 100, 0);
|
|
157
|
+
appendPathLineTo(path, 100, 100);
|
|
158
|
+
return path;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
function empty(): Path {
|
|
162
|
+
return createPath();
|
|
163
|
+
}
|
|
138
164
|
// A straight horizontal line from (0,0) to (100,0): arc length 100.
|
|
139
165
|
describe('updateMotionPath', () => {
|
|
140
166
|
it('advances distance by speed * deltaTime', () => {
|
|
@@ -220,23 +246,3 @@ describe('updateMotionPath', () => {
|
|
|
220
246
|
expect(mp.distance).toBe(0);
|
|
221
247
|
});
|
|
222
248
|
});
|
|
223
|
-
|
|
224
|
-
// A straight horizontal line from (0,0) to (100,0): arc length 100.
|
|
225
|
-
function line(): Path {
|
|
226
|
-
const path = createPath();
|
|
227
|
-
appendPathMoveTo(path, 0, 0);
|
|
228
|
-
appendPathLineTo(path, 100, 0);
|
|
229
|
-
return path;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function corner(): Path {
|
|
233
|
-
const path = createPath();
|
|
234
|
-
appendPathMoveTo(path, 0, 0);
|
|
235
|
-
appendPathLineTo(path, 100, 0);
|
|
236
|
-
appendPathLineTo(path, 100, 100);
|
|
237
|
-
return path;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
function empty(): Path {
|
|
241
|
-
return createPath();
|
|
242
|
-
}
|