@flighthq/camera 0.5.1-next.4304.322dc96 → 0.5.1-next.4328.05c3820
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/dist/camera.js +2 -2
- package/dist/contract.js +19 -19
- package/dist/cubeCapture.js +1 -1
- package/dist/culling.js +1 -1
- package/dist/enableCameraGuards.js +3 -3
- package/dist/frustumCorners.js +1 -1
- package/dist/index.js +19 -19
- package/dist/intersection.js +1 -1
- package/dist/parallax.js +1 -1
- package/dist/picking.js +1 -1
- package/dist/projection2d.js +1 -1
- package/dist/shadowCamera.js +2 -2
- package/dist/visibleBounds.js +1 -1
- package/dist/zoom.js +1 -1
- package/package.json +6 -6
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.4328.05c3820](https://github.com/flighthq/flight/tree/05c3820b52a956705fde339318e349acb4b4c4e9/packages/camera)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/05c3820b52a956705fde339318e349acb4b4c4e9/LICENSE.md)
|
package/dist/camera.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { allocateEntity, finishEntity } from '@flighthq/entity/contract';
|
|
2
2
|
import { createMatrix4, createVector2, inverseMatrix4, multiplyMatrix4, setMatrix4LookAt, } from '@flighthq/geometry/contract';
|
|
3
|
-
import { setProjectionMatrix4 } from
|
|
4
|
-
import { applyObliqueNearClipPlane } from
|
|
3
|
+
import { setProjectionMatrix4 } from './projection.js';
|
|
4
|
+
import { applyObliqueNearClipPlane } from './reflection.js';
|
|
5
5
|
export function createCamera3D(opts) {
|
|
6
6
|
const out = allocateEntity();
|
|
7
7
|
initializeCamera3D(out, opts);
|
package/dist/contract.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export * from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export * from
|
|
19
|
-
export * from
|
|
1
|
+
export * from './basis.js';
|
|
2
|
+
export * from './camera.js';
|
|
3
|
+
export * from './camera2d.js';
|
|
4
|
+
export * from './cubeCapture.js';
|
|
5
|
+
export * from './culling.js';
|
|
6
|
+
export * from './depth.js';
|
|
7
|
+
export * from './enableCameraGuards.js';
|
|
8
|
+
export * from './explainCamera3DView.js';
|
|
9
|
+
export * from './frustumCorners.js';
|
|
10
|
+
export * from './intersection.js';
|
|
11
|
+
export * from './parallax.js';
|
|
12
|
+
export * from './picking.js';
|
|
13
|
+
export * from './projection.js';
|
|
14
|
+
export * from './projection2d.js';
|
|
15
|
+
export * from './reflection.js';
|
|
16
|
+
export * from './shadowCamera.js';
|
|
17
|
+
export * from './viewMatrix.js';
|
|
18
|
+
export * from './visibleBounds.js';
|
|
19
|
+
export * from './zoom.js';
|
|
20
20
|
//# sourceMappingURL=contract.js.map
|
package/dist/cubeCapture.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { setMatrix4LookAt } from '@flighthq/geometry/contract';
|
|
2
|
-
import { createPerspectiveProjection } from
|
|
2
|
+
import { createPerspectiveProjection } from './projection.js';
|
|
3
3
|
// Sets `out` to the view and projection for one face of a cube-map capture from `position`.
|
|
4
4
|
// `face` is 0–5 corresponding to +X, −X, +Y, −Y, +Z, −Z (matching CubeFacePositiveX through
|
|
5
5
|
// CubeFaceNegativeZ in @flighthq/types). The projection is a 90° FOV square perspective
|
package/dist/culling.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createFrustum, createMatrix4, isFrustumContainingPoint, isFrustumIntersectingAabb, isFrustumIntersectingSphere, setFrustumFromMatrix4, } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera3DViewProjectionMatrix4 } from
|
|
2
|
+
import { getCamera3DViewProjectionMatrix4 } from './camera.js';
|
|
3
3
|
// Extracts the six clip planes of the camera's view frustum into `out` and returns true.
|
|
4
4
|
// The planes are normalized with inward-pointing normals (the convention used by geometry's
|
|
5
5
|
// isFrustumContainingPoint / isFrustumIntersectingAabb / isFrustumIntersectingSphere).
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { logOnce } from '@flighthq/log/contract';
|
|
2
2
|
import { LogLevel } from '@flighthq/types/contract';
|
|
3
|
-
import { setCamera3DViewGuard } from
|
|
4
|
-
import { explainCamera3DView } from
|
|
5
|
-
import { setCamera2DVisibleBoundsGuard } from
|
|
3
|
+
import { setCamera3DViewGuard } from './camera.js';
|
|
4
|
+
import { explainCamera3DView } from './explainCamera3DView.js';
|
|
5
|
+
import { setCamera2DVisibleBoundsGuard } from './visibleBounds.js';
|
|
6
6
|
export function areCameraGuardsEnabled() {
|
|
7
7
|
return cameraGuardsEnabled;
|
|
8
8
|
}
|
package/dist/frustumCorners.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMatrix4, inverseMatrix4 } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera3DViewProjectionMatrix4 } from
|
|
2
|
+
import { getCamera3DViewProjectionMatrix4 } from './camera.js';
|
|
3
3
|
// Writes the 8 world-space corners of the camera frustum into `out` (a length-8 array of
|
|
4
4
|
// Vector3Like) and returns true. Returns false (leaving `out` untouched) when the
|
|
5
5
|
// view-projection is non-invertible. `aspect` is viewport width / height.
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export { createCamera3D, getCamera3DInverseViewProjectionMatrix4, getCamera3DViewProjectionMatrix4, setCamera3DAspect, setCamera3DJitter, setCamera3DViewMatrix4FromLookAt, setCamera3DViewMatrix4FromMatrix4, updateCamera3DInverseViewProjection, } from
|
|
3
|
-
export { createCamera2D, setCamera2DLookAt } from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
10
|
-
export * from
|
|
11
|
-
export * from
|
|
12
|
-
export * from
|
|
13
|
-
export { createOrthographicProjection, createPerspectiveProjection, createRawProjection, getOrthographicProjectionTexelSize, isOrthographicProjection, isPerspectiveProjection, isRawProjection, setProjectionMatrix4, } from
|
|
14
|
-
export * from
|
|
15
|
-
export * from
|
|
16
|
-
export * from
|
|
17
|
-
export * from
|
|
18
|
-
export { getCamera2DVisibleBounds } from
|
|
19
|
-
export * from
|
|
1
|
+
export * from './basis.js';
|
|
2
|
+
export { createCamera3D, getCamera3DInverseViewProjectionMatrix4, getCamera3DViewProjectionMatrix4, setCamera3DAspect, setCamera3DJitter, setCamera3DViewMatrix4FromLookAt, setCamera3DViewMatrix4FromMatrix4, updateCamera3DInverseViewProjection, } from './camera.js';
|
|
3
|
+
export { createCamera2D, setCamera2DLookAt } from './camera2d.js';
|
|
4
|
+
export * from './cubeCapture.js';
|
|
5
|
+
export * from './culling.js';
|
|
6
|
+
export * from './depth.js';
|
|
7
|
+
export * from './enableCameraGuards.js';
|
|
8
|
+
export * from './explainCamera3DView.js';
|
|
9
|
+
export * from './frustumCorners.js';
|
|
10
|
+
export * from './intersection.js';
|
|
11
|
+
export * from './parallax.js';
|
|
12
|
+
export * from './picking.js';
|
|
13
|
+
export { createOrthographicProjection, createPerspectiveProjection, createRawProjection, getOrthographicProjectionTexelSize, isOrthographicProjection, isPerspectiveProjection, isRawProjection, setProjectionMatrix4, } from './projection.js';
|
|
14
|
+
export * from './projection2d.js';
|
|
15
|
+
export * from './reflection.js';
|
|
16
|
+
export * from './shadowCamera.js';
|
|
17
|
+
export * from './viewMatrix.js';
|
|
18
|
+
export { getCamera2DVisibleBounds } from './visibleBounds.js';
|
|
19
|
+
export * from './zoom.js';
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
package/dist/intersection.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getCamera3DScreenToWorldRay, getCamera3DWorldToScreen } from
|
|
1
|
+
import { getCamera3DScreenToWorldRay, getCamera3DWorldToScreen } from './picking.js';
|
|
2
2
|
// Returns the world-space ray from the camera through the center of a bounding sphere, writing
|
|
3
3
|
// the result into `out` and returning true. The ray is suitable for picking and hover-highlight
|
|
4
4
|
// queries: it passes through the screen-space projection of the sphere center, and represents
|
package/dist/parallax.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMatrix } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera2DViewMatrix } from
|
|
2
|
+
import { getCamera2DViewMatrix } from './viewMatrix.js';
|
|
3
3
|
// Writes the screen-space scroll offset for a parallax layer at depth `factor` into `out`.
|
|
4
4
|
//
|
|
5
5
|
// Convention: the offset is the camera's own screen-space translation (the view matrix translation
|
package/dist/picking.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMatrix4, createVector3, inverseMatrix4, normalizeVector3, subtractVector3, } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera3DViewProjectionMatrix4 } from
|
|
2
|
+
import { getCamera3DViewProjectionMatrix4 } from './camera.js';
|
|
3
3
|
// Writes the world-space ray from the camera through an NDC screen point (ndcX, ndcY) into
|
|
4
4
|
// `out` and returns true, or returns false (leaving `out` untouched) when the view-projection
|
|
5
5
|
// is non-invertible. NDC coordinates range from -1 to +1 on both axes (center = 0, top-right =
|
package/dist/projection2d.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMatrix, inverseMatrixTransformPointXY, matrixTransformPointXY } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera2DViewMatrix } from
|
|
2
|
+
import { getCamera2DViewMatrix } from './viewMatrix.js';
|
|
3
3
|
// Projects a world point to its screen position through the camera's view matrix and writes the
|
|
4
4
|
// result to `out` (world -> screen). The inverse is `unprojectCamera2DPoint`.
|
|
5
5
|
export function projectCamera2DPoint(camera, viewportWidth, viewportHeight, worldX, worldY, out) {
|
package/dist/shadowCamera.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { setCamera3DViewMatrix4FromLookAt } from
|
|
2
|
-
import { createOrthographicProjection } from
|
|
1
|
+
import { setCamera3DViewMatrix4FromLookAt } from './camera.js';
|
|
2
|
+
import { createOrthographicProjection } from './projection.js';
|
|
3
3
|
// Configures `camera` as the shadow camera for a directional light — the spec's "a shadow camera is
|
|
4
4
|
// just a Camera3D placed at the light." Looks along `lightDirection` (the light's travel direction) at
|
|
5
5
|
// the centre of `sceneBounds`, with an orthographic frustum sized to the scene's bounding sphere so the
|
package/dist/visibleBounds.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createMatrix, inverseMatrix, matrixTransformBounds } from '@flighthq/geometry/contract';
|
|
2
|
-
import { getCamera2DViewMatrix } from
|
|
2
|
+
import { getCamera2DViewMatrix } from './viewMatrix.js';
|
|
3
3
|
// Writes the axis-aligned world rectangle the viewport currently covers into `out` — the conservative
|
|
4
4
|
// cull bound that feeds `@flighthq/spatial` / the renderer's cull. Computed by unprojecting the four
|
|
5
5
|
// screen corners and taking their world-space bounding box: at zoom 1, rotation 0 this is exact; at
|
package/dist/zoom.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createVector2 } from '@flighthq/geometry/contract';
|
|
2
|
-
import { unprojectCamera2DPoint } from
|
|
2
|
+
import { unprojectCamera2DPoint } from './projection2d.js';
|
|
3
3
|
// Sets the camera's `zoom` while keeping the world point currently under `(screenX, screenY)` fixed
|
|
4
4
|
// on screen (zoom-to-cursor). Because the view's linear part depends only on zoom and rotation (not
|
|
5
5
|
// position), the world point under a screen point shifts by exactly the change in the camera's
|
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.4328.05c3820",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,13 +38,13 @@
|
|
|
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.4328.05c3820",
|
|
42
|
+
"@flighthq/geometry": "0.5.1-next.4328.05c3820",
|
|
43
|
+
"@flighthq/log": "0.5.1-next.4328.05c3820",
|
|
44
|
+
"@flighthq/types": "0.5.1-next.4328.05c3820"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"typescript": "^
|
|
47
|
+
"typescript": "^7.0.2"
|
|
48
48
|
},
|
|
49
49
|
"description": "2D and 3D cameras: projection, view, and view-projection helpers",
|
|
50
50
|
"sideEffects": false
|