@flighthq/camera 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/camera.test.ts +7 -1
- package/src/camera2d.test.ts +6 -1
- package/src/projection.test.ts +14 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/camera`. The `@fligh
|
|
|
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/camera@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/camera@0.5.1-next.905.5fbf787](https://github.com/flighthq/flight/tree/5fbf7874064c384307542d68b4dcb6a895ff0dcf/packages/camera)
|
|
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/camera",
|
|
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/log": "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/log": "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/camera.test.ts
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
createCamera3D,
|
|
11
11
|
getCamera3DInverseViewProjectionMatrix4,
|
|
12
12
|
getCamera3DViewProjectionMatrix4,
|
|
13
|
+
initializeCamera3D,
|
|
13
14
|
setCamera3DAspect,
|
|
14
15
|
setCamera3DJitter,
|
|
15
16
|
setCamera3DViewGuard,
|
|
@@ -124,6 +125,12 @@ describe('getCamera3DViewProjectionMatrix4', () => {
|
|
|
124
125
|
});
|
|
125
126
|
});
|
|
126
127
|
|
|
128
|
+
describe('initializeCamera3D', () => {
|
|
129
|
+
it('is the construction initializer of createCamera3D', () => {
|
|
130
|
+
expect(typeof initializeCamera3D).toBe('function');
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
127
134
|
describe('setCamera3DAspect', () => {
|
|
128
135
|
it('writes the aspect on a perspective projection in place', () => {
|
|
129
136
|
const projection = createPerspectiveProjection({ aspect: 1, fovY: 1 });
|
|
@@ -216,7 +223,6 @@ describe('setCamera3DViewMatrix4FromMatrix4', () => {
|
|
|
216
223
|
}
|
|
217
224
|
});
|
|
218
225
|
});
|
|
219
|
-
|
|
220
226
|
describe('updateCamera3DInverseViewProjection', () => {
|
|
221
227
|
it('refreshes the required cache from the jittered projection', () => {
|
|
222
228
|
const camera = createCamera3D({
|
package/src/camera2d.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest';
|
|
2
2
|
|
|
3
|
-
import { createCamera2D } from './camera2d';
|
|
3
|
+
import { createCamera2D, initializeCamera2D } from './camera2d';
|
|
4
4
|
|
|
5
5
|
describe('createCamera2D', () => {
|
|
6
6
|
it('uses identity defaults for an unconfigured camera', () => {
|
|
@@ -21,3 +21,8 @@ describe('createCamera2D', () => {
|
|
|
21
21
|
expect(camera.rotation).toBeCloseTo(Math.PI / 4, 12);
|
|
22
22
|
});
|
|
23
23
|
});
|
|
24
|
+
describe('initializeCamera2D', () => {
|
|
25
|
+
it('is the construction initializer of createCamera2D', () => {
|
|
26
|
+
expect(typeof initializeCamera2D).toBe('function');
|
|
27
|
+
});
|
|
28
|
+
});
|
package/src/projection.test.ts
CHANGED
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
createOrthographicProjection,
|
|
7
7
|
createPerspectiveProjection,
|
|
8
8
|
getOrthographicProjectionTexelSize,
|
|
9
|
+
initializeOrthographicProjection,
|
|
10
|
+
initializePerspectiveProjection,
|
|
9
11
|
isOrthographicProjection,
|
|
10
12
|
isPerspectiveProjection,
|
|
11
13
|
setProjectionMatrix4,
|
|
@@ -45,6 +47,18 @@ describe('getOrthographicProjectionTexelSize', () => {
|
|
|
45
47
|
});
|
|
46
48
|
});
|
|
47
49
|
|
|
50
|
+
describe('initializeOrthographicProjection', () => {
|
|
51
|
+
it('is the construction initializer of createOrthographicProjection', () => {
|
|
52
|
+
expect(typeof initializeOrthographicProjection).toBe('function');
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
describe('initializePerspectiveProjection', () => {
|
|
57
|
+
it('is the construction initializer of createPerspectiveProjection', () => {
|
|
58
|
+
expect(typeof initializePerspectiveProjection).toBe('function');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
|
|
48
62
|
describe('isOrthographicProjection', () => {
|
|
49
63
|
it('is true for orthographic and false for perspective', () => {
|
|
50
64
|
const ortho = createOrthographicProjection({ halfHeight: 1, halfWidth: 1 });
|
|
@@ -53,7 +67,6 @@ describe('isOrthographicProjection', () => {
|
|
|
53
67
|
expect(isOrthographicProjection(persp)).toBe(false);
|
|
54
68
|
});
|
|
55
69
|
});
|
|
56
|
-
|
|
57
70
|
describe('isPerspectiveProjection', () => {
|
|
58
71
|
it('is true for perspective and false for orthographic', () => {
|
|
59
72
|
const persp = createPerspectiveProjection({ aspect: 1, fovY: 1 });
|