@loaders.gl/tiles 3.1.0-alpha.5 → 3.1.0-beta.5
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/dist/bundle.d.ts +1 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +8136 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +35 -0
- package/dist/es5/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/es5/tileset/tileset-cache.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list-node.js +7 -0
- package/dist/es5/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/es5/utils/doubly-linked-list.js +5 -3
- package/dist/es5/utils/doubly-linked-list.js.map +1 -1
- package/dist/es5/utils/managed-array.js +7 -1
- package/dist/es5/utils/managed-array.js.map +1 -1
- package/dist/esm/tileset/helpers/i3s-lod.js.map +1 -1
- package/dist/esm/tileset/tileset-cache.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list-node.js +7 -0
- package/dist/esm/utils/doubly-linked-list-node.js.map +1 -1
- package/dist/esm/utils/doubly-linked-list.js +6 -3
- package/dist/esm/utils/doubly-linked-list.js.map +1 -1
- package/dist/esm/utils/managed-array.js +7 -1
- package/dist/esm/utils/managed-array.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +28 -0
- package/dist/tileset/helpers/3d-tiles-options.d.ts +1 -0
- package/dist/tileset/helpers/3d-tiles-options.d.ts.map +1 -0
- package/dist/tileset/helpers/3d-tiles-options.js +9 -0
- package/dist/tileset/helpers/bounding-volume.d.ts +1 -0
- package/dist/tileset/helpers/bounding-volume.d.ts.map +1 -0
- package/dist/tileset/helpers/bounding-volume.js +177 -0
- package/dist/tileset/helpers/frame-state.d.ts +1 -0
- package/dist/tileset/helpers/frame-state.d.ts.map +1 -0
- package/dist/tileset/helpers/frame-state.js +70 -0
- package/dist/tileset/helpers/i3s-lod.d.ts +2 -1
- package/dist/tileset/helpers/i3s-lod.d.ts.map +1 -0
- package/dist/tileset/helpers/i3s-lod.js +83 -0
- package/dist/tileset/helpers/tiles-3d-lod.d.ts +1 -0
- package/dist/tileset/helpers/tiles-3d-lod.d.ts.map +1 -0
- package/dist/tileset/helpers/tiles-3d-lod.js +116 -0
- package/dist/tileset/helpers/transform-utils.d.ts +1 -0
- package/dist/tileset/helpers/transform-utils.d.ts.map +1 -0
- package/dist/tileset/helpers/transform-utils.js +52 -0
- package/dist/tileset/helpers/zoom.d.ts +1 -0
- package/dist/tileset/helpers/zoom.d.ts.map +1 -0
- package/dist/tileset/helpers/zoom.js +42 -0
- package/dist/tileset/tile-3d.d.ts +1 -0
- package/dist/tileset/tile-3d.d.ts.map +1 -0
- package/dist/tileset/tile-3d.js +554 -0
- package/dist/tileset/tileset-3d.d.ts +1 -0
- package/dist/tileset/tileset-3d.d.ts.map +1 -0
- package/dist/tileset/tileset-3d.js +601 -0
- package/dist/tileset/tileset-cache.d.ts +1 -0
- package/dist/tileset/tileset-cache.d.ts.map +1 -0
- package/dist/tileset/tileset-cache.js +79 -0
- package/dist/tileset/traversers/i3s-tile-manager.d.ts +1 -0
- package/dist/tileset/traversers/i3s-tile-manager.d.ts.map +1 -0
- package/dist/tileset/traversers/i3s-tile-manager.js +36 -0
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts +1 -0
- package/dist/tileset/traversers/i3s-tileset-traverser.d.ts.map +1 -0
- package/dist/tileset/traversers/i3s-tileset-traverser.js +85 -0
- package/dist/tileset/traversers/tileset-3d-traverser.d.ts +1 -0
- package/dist/tileset/traversers/tileset-3d-traverser.d.ts.map +1 -0
- package/dist/tileset/traversers/tileset-3d-traverser.js +55 -0
- package/dist/tileset/traversers/tileset-traverser.d.ts +1 -0
- package/dist/tileset/traversers/tileset-traverser.d.ts.map +1 -0
- package/dist/tileset/traversers/tileset-traverser.js +294 -0
- package/dist/utils/doubly-linked-list-node.d.ts +2 -1
- package/dist/utils/doubly-linked-list-node.d.ts.map +1 -0
- package/dist/utils/doubly-linked-list-node.js +17 -0
- package/dist/utils/doubly-linked-list.d.ts +7 -6
- package/dist/utils/doubly-linked-list.d.ts.map +1 -0
- package/dist/utils/doubly-linked-list.js +100 -0
- package/dist/utils/managed-array.d.ts +10 -9
- package/dist/utils/managed-array.d.ts.map +1 -0
- package/dist/utils/managed-array.js +151 -0
- package/package.json +6 -7
- package/src/tileset/helpers/i3s-lod.ts +1 -1
- package/src/tileset/tileset-cache.ts +2 -0
- package/src/utils/{doubly-linked-list-node.js → doubly-linked-list-node.ts} +4 -0
- package/src/utils/{doubly-linked-list.js → doubly-linked-list.ts} +3 -5
- package/src/utils/{managed-array.js → managed-array.ts} +4 -1
- package/dist/dist.min.js +0 -2
- package/dist/dist.min.js.map +0 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is derived from the Cesium code base under Apache 2 license
|
|
3
|
+
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createBoundingVolume = void 0;
|
|
6
|
+
/* eslint-disable */
|
|
7
|
+
const core_1 = require("@math.gl/core");
|
|
8
|
+
const culling_1 = require("@math.gl/culling");
|
|
9
|
+
const geospatial_1 = require("@math.gl/geospatial");
|
|
10
|
+
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
11
|
+
// const scratchProjectedBoundingSphere = new BoundingSphere();
|
|
12
|
+
function defined(x) {
|
|
13
|
+
return x !== undefined && x !== null;
|
|
14
|
+
}
|
|
15
|
+
// const scratchMatrix = new Matrix3();
|
|
16
|
+
const scratchScale = new core_1.Vector3();
|
|
17
|
+
const scratchNorthWest = new core_1.Vector3();
|
|
18
|
+
const scratchSouthEast = new core_1.Vector3();
|
|
19
|
+
// const scratchRectangle = new Rectangle();
|
|
20
|
+
// const scratchOrientedBoundingBox = new OrientedBoundingBox();
|
|
21
|
+
// const scratchTransform = new Matrix4();
|
|
22
|
+
/**
|
|
23
|
+
* Create a bounding volume from the tile's bounding volume header.
|
|
24
|
+
* @param {Object} boundingVolumeHeader The tile's bounding volume header.
|
|
25
|
+
* @param {Matrix4} transform The transform to apply to the bounding volume.
|
|
26
|
+
* @param [result] The object onto which to store the result.
|
|
27
|
+
* @returns The modified result parameter or a new TileBoundingVolume instance if none was provided.
|
|
28
|
+
*/
|
|
29
|
+
function createBoundingVolume(boundingVolumeHeader, transform, result) {
|
|
30
|
+
(0, loader_utils_1.assert)(boundingVolumeHeader, '3D Tile: boundingVolume must be defined');
|
|
31
|
+
// boundingVolume schema:
|
|
32
|
+
// https://github.com/AnalyticalGraphicsInc/3d-tiles/blob/master/specification/schema/boundingVolume.schema.json
|
|
33
|
+
if (boundingVolumeHeader.box) {
|
|
34
|
+
return createBox(boundingVolumeHeader.box, transform, result);
|
|
35
|
+
}
|
|
36
|
+
if (boundingVolumeHeader.region) {
|
|
37
|
+
// [west, south, east, north, minimum height, maximum height]
|
|
38
|
+
// Latitudes and longitudes are in the WGS 84 datum as defined in EPSG 4979 and are in radians.
|
|
39
|
+
// Heights are in meters above (or below) the WGS 84 ellipsoid.
|
|
40
|
+
const [west, south, east, north, minHeight, maxHeight] = boundingVolumeHeader.region;
|
|
41
|
+
const northWest = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian([(0, core_1.degrees)(west), (0, core_1.degrees)(north), minHeight], scratchNorthWest);
|
|
42
|
+
const southEast = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian([(0, core_1.degrees)(east), (0, core_1.degrees)(south), maxHeight], scratchSouthEast);
|
|
43
|
+
const centerInCartesian = new core_1.Vector3().addVectors(northWest, southEast).multiplyScalar(0.5);
|
|
44
|
+
const radius = new core_1.Vector3().subVectors(northWest, southEast).len() / 2.0;
|
|
45
|
+
// TODO improve region boundingVolume
|
|
46
|
+
// for now, create a sphere as the boundingVolume instead of box
|
|
47
|
+
return createSphere([centerInCartesian[0], centerInCartesian[1], centerInCartesian[2], radius], new core_1.Matrix4());
|
|
48
|
+
}
|
|
49
|
+
if (boundingVolumeHeader.sphere) {
|
|
50
|
+
return createSphere(boundingVolumeHeader.sphere, transform, result);
|
|
51
|
+
}
|
|
52
|
+
throw new Error('3D Tile: boundingVolume must contain a sphere, region, or box');
|
|
53
|
+
}
|
|
54
|
+
exports.createBoundingVolume = createBoundingVolume;
|
|
55
|
+
function createBox(box, transform, result) {
|
|
56
|
+
// https://math.gl/modules/culling/docs/api-reference/oriented-bounding-box
|
|
57
|
+
// 1. A half-axes based representation.
|
|
58
|
+
// box: An array of 12 numbers that define an oriented bounding box.
|
|
59
|
+
// The first three elements define the x, y, and z values for the center of the box.
|
|
60
|
+
// The next three elements (with indices 3, 4, and 5) define the x axis direction and half-length.
|
|
61
|
+
// The next three elements (indices 6, 7, and 8) define the y axis direction and half-length.
|
|
62
|
+
// The last three elements (indices 9, 10, and 11) define the z axis direction and half-length.
|
|
63
|
+
// 2. A half-size-quaternion based representation.
|
|
64
|
+
// box: An array of 10 numbers that define an oriented bounding box.
|
|
65
|
+
// The first three elements define the x, y, and z values for the center of the box in a right-handed 3-axis (x, y, z) Cartesian coordinate system where the z-axis is up.
|
|
66
|
+
// The next three elements (with indices 3, 4, and 5) define the halfSize.
|
|
67
|
+
// The last four elements (indices 6, 7, 8 and 10) define the quaternion.
|
|
68
|
+
const center = new core_1.Vector3(box[0], box[1], box[2]);
|
|
69
|
+
transform.transform(center, center);
|
|
70
|
+
let origin = [];
|
|
71
|
+
if (box.length === 10) {
|
|
72
|
+
const halfSize = box.slice(3, 6);
|
|
73
|
+
const quaternion = new core_1.Quaternion();
|
|
74
|
+
quaternion.fromArray(box, 6);
|
|
75
|
+
const x = new core_1.Vector3([1, 0, 0]);
|
|
76
|
+
const y = new core_1.Vector3([0, 1, 0]);
|
|
77
|
+
const z = new core_1.Vector3([0, 0, 1]);
|
|
78
|
+
x.transformByQuaternion(quaternion);
|
|
79
|
+
x.scale(halfSize[0]);
|
|
80
|
+
y.transformByQuaternion(quaternion);
|
|
81
|
+
y.scale(halfSize[1]);
|
|
82
|
+
z.transformByQuaternion(quaternion);
|
|
83
|
+
z.scale(halfSize[2]);
|
|
84
|
+
origin = [...x.toArray(), ...y.toArray(), ...z.toArray()];
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
origin = [...box.slice(3, 6), ...box.slice(6, 9), ...box.slice(9, 12)];
|
|
88
|
+
}
|
|
89
|
+
const xAxis = transform.transformAsVector(origin.slice(0, 3));
|
|
90
|
+
const yAxis = transform.transformAsVector(origin.slice(3, 6));
|
|
91
|
+
const zAxis = transform.transformAsVector(origin.slice(6, 9));
|
|
92
|
+
const halfAxes = new core_1.Matrix3([
|
|
93
|
+
xAxis[0],
|
|
94
|
+
xAxis[1],
|
|
95
|
+
xAxis[2],
|
|
96
|
+
yAxis[0],
|
|
97
|
+
yAxis[1],
|
|
98
|
+
yAxis[2],
|
|
99
|
+
zAxis[0],
|
|
100
|
+
zAxis[1],
|
|
101
|
+
zAxis[2]
|
|
102
|
+
]);
|
|
103
|
+
if (defined(result)) {
|
|
104
|
+
result.center = center;
|
|
105
|
+
result.halfAxes = halfAxes;
|
|
106
|
+
return result;
|
|
107
|
+
}
|
|
108
|
+
return new culling_1.OrientedBoundingBox(center, halfAxes);
|
|
109
|
+
}
|
|
110
|
+
/*
|
|
111
|
+
function createBoxFromTransformedRegion(region, transform, initialTransform, result) {
|
|
112
|
+
const rectangle = Rectangle.unpack(region, 0, scratchRectangle);
|
|
113
|
+
const minimumHeight = region[4];
|
|
114
|
+
const maximumHeight = region[5];
|
|
115
|
+
|
|
116
|
+
const orientedBoundingBox = OrientedBoundingBox.fromRectangle(
|
|
117
|
+
rectangle,
|
|
118
|
+
minimumHeight,
|
|
119
|
+
maximumHeight,
|
|
120
|
+
Ellipsoid.WGS84,
|
|
121
|
+
scratchOrientedBoundingBox
|
|
122
|
+
);
|
|
123
|
+
const center = orientedBoundingBox.center;
|
|
124
|
+
const halfAxes = orientedBoundingBox.halfAxes;
|
|
125
|
+
|
|
126
|
+
// A region bounding volume is not transformed by the transform in the tileset JSON,
|
|
127
|
+
// but may be transformed by additional transforms applied in Cesium.
|
|
128
|
+
// This is why the transform is calculated as the difference between the initial transform and the current transform.
|
|
129
|
+
transform = Matrix4.multiplyTransformation(
|
|
130
|
+
transform,
|
|
131
|
+
Matrix4.inverseTransformation(initialTransform, scratchTransform),
|
|
132
|
+
scratchTransform
|
|
133
|
+
);
|
|
134
|
+
center = Matrix4.multiplyByPoint(transform, center, center);
|
|
135
|
+
const rotationScale = Matrix4.getRotation(transform, scratchMatrix);
|
|
136
|
+
halfAxes = Matrix3.multiply(rotationScale, halfAxes, halfAxes);
|
|
137
|
+
|
|
138
|
+
if (defined(result) && result instanceof TileOrientedBoundingBox) {
|
|
139
|
+
result.update(center, halfAxes);
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
return new TileOrientedBoundingBox(center, halfAxes);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function createRegion(region, transform, initialTransform, result) {
|
|
147
|
+
if (!Matrix4.equalsEpsilon(transform, initialTransform, CesiumMath.EPSILON8)) {
|
|
148
|
+
return createBoxFromTransformedRegion(region, transform, initialTransform, result);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (defined(result)) {
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
const rectangleRegion = Rectangle.unpack(region, 0, scratchRectangle);
|
|
156
|
+
|
|
157
|
+
return new TileBoundingRegion({
|
|
158
|
+
rectangle: rectangleRegion,
|
|
159
|
+
minimumHeight: region[4],
|
|
160
|
+
maximumHeight: region[5]
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
*/
|
|
164
|
+
function createSphere(sphere, transform, result) {
|
|
165
|
+
// Find the transformed center
|
|
166
|
+
const center = new core_1.Vector3(sphere[0], sphere[1], sphere[2]);
|
|
167
|
+
transform.transform(center, center);
|
|
168
|
+
const scale = transform.getScale(scratchScale);
|
|
169
|
+
const uniformScale = Math.max(Math.max(scale[0], scale[1]), scale[2]);
|
|
170
|
+
const radius = sphere[3] * uniformScale;
|
|
171
|
+
if (defined(result)) {
|
|
172
|
+
result.center = center;
|
|
173
|
+
result.radius = radius;
|
|
174
|
+
return result;
|
|
175
|
+
}
|
|
176
|
+
return new culling_1.BoundingSphere(center, radius);
|
|
177
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frame-state.d.ts","sourceRoot":"","sources":["../../../src/tileset/helpers/frame-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,aAAa,EAAQ,MAAM,kBAAkB,CAAC;AAGtD,oBAAY,UAAU,GAAG;IACvB,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,EAAE,CAAC;QACnB,SAAS,EAAE,MAAM,EAAE,CAAC;QACpB,EAAE,EAAE,MAAM,EAAE,CAAC;KACd,CAAC;IACF,QAAQ,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,aAAa,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAeF,wBAAgB,aAAa,CAAC,QAAQ,KAAA,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CA6CvE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFrameState = void 0;
|
|
4
|
+
const core_1 = require("@math.gl/core");
|
|
5
|
+
const culling_1 = require("@math.gl/culling");
|
|
6
|
+
const geospatial_1 = require("@math.gl/geospatial");
|
|
7
|
+
const scratchVector = new core_1.Vector3();
|
|
8
|
+
const scratchPosition = new core_1.Vector3();
|
|
9
|
+
const cullingVolume = new culling_1.CullingVolume([
|
|
10
|
+
new culling_1.Plane(),
|
|
11
|
+
new culling_1.Plane(),
|
|
12
|
+
new culling_1.Plane(),
|
|
13
|
+
new culling_1.Plane(),
|
|
14
|
+
new culling_1.Plane(),
|
|
15
|
+
new culling_1.Plane()
|
|
16
|
+
]);
|
|
17
|
+
// Extracts a frame state appropriate for tile culling from a deck.gl viewport
|
|
18
|
+
// TODO - this could likely be generalized and merged back into deck.gl for other culling scenarios
|
|
19
|
+
function getFrameState(viewport, frameNumber) {
|
|
20
|
+
// Traverse and and request. Update _selectedTiles so that we know what to render.
|
|
21
|
+
const { cameraDirection, cameraUp, height } = viewport;
|
|
22
|
+
const { metersPerUnit } = viewport.distanceScales;
|
|
23
|
+
const viewportCenterCartographic = [viewport.longitude, viewport.latitude, 0];
|
|
24
|
+
// TODO - Ellipsoid.eastNorthUpToFixedFrame() breaks on raw array, create a Vector.
|
|
25
|
+
// TODO - Ellipsoid.eastNorthUpToFixedFrame() takes a cartesian, is that intuitive?
|
|
26
|
+
const viewportCenterCartesian = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian(viewportCenterCartographic, new core_1.Vector3());
|
|
27
|
+
const enuToFixedTransform = geospatial_1.Ellipsoid.WGS84.eastNorthUpToFixedFrame(viewportCenterCartesian);
|
|
28
|
+
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
29
|
+
const cameraPositionCartesian = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, new core_1.Vector3());
|
|
30
|
+
// These should still be normalized as the transform has scale 1 (goes from meters to meters)
|
|
31
|
+
const cameraDirectionCartesian = new core_1.Vector3(
|
|
32
|
+
// @ts-ignore
|
|
33
|
+
enuToFixedTransform.transformAsVector(new core_1.Vector3(cameraDirection).scale(metersPerUnit))).normalize();
|
|
34
|
+
const cameraUpCartesian = new core_1.Vector3(
|
|
35
|
+
// @ts-ignore
|
|
36
|
+
enuToFixedTransform.transformAsVector(new core_1.Vector3(cameraUp).scale(metersPerUnit))).normalize();
|
|
37
|
+
commonSpacePlanesToWGS84(viewport, viewportCenterCartesian);
|
|
38
|
+
// TODO: make a file/class for frameState and document what needs to be attached to this so that traversal can function
|
|
39
|
+
return {
|
|
40
|
+
camera: {
|
|
41
|
+
position: cameraPositionCartesian,
|
|
42
|
+
direction: cameraDirectionCartesian,
|
|
43
|
+
up: cameraUpCartesian
|
|
44
|
+
},
|
|
45
|
+
viewport,
|
|
46
|
+
height,
|
|
47
|
+
cullingVolume,
|
|
48
|
+
frameNumber,
|
|
49
|
+
sseDenominator: 1.15 // Assumes fovy = 60 degrees
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
exports.getFrameState = getFrameState;
|
|
53
|
+
function commonSpacePlanesToWGS84(viewport, viewportCenterCartesian) {
|
|
54
|
+
// Extract frustum planes based on current view.
|
|
55
|
+
const frustumPlanes = viewport.getFrustumPlanes();
|
|
56
|
+
let i = 0;
|
|
57
|
+
for (const dir in frustumPlanes) {
|
|
58
|
+
const plane = frustumPlanes[dir];
|
|
59
|
+
const distanceToCenter = plane.normal.dot(viewport.center);
|
|
60
|
+
scratchPosition
|
|
61
|
+
.copy(plane.normal)
|
|
62
|
+
.scale(plane.distance - distanceToCenter)
|
|
63
|
+
.add(viewport.center);
|
|
64
|
+
const cartographicPos = viewport.unprojectPosition(scratchPosition);
|
|
65
|
+
const cartesianPos = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian(cartographicPos, new core_1.Vector3());
|
|
66
|
+
cullingVolume.planes[i++].fromPointNormal(cartesianPos,
|
|
67
|
+
// Want the normal to point into the frustum since that's what culling expects
|
|
68
|
+
scratchVector.copy(viewportCenterCartesian).subtract(cartesianPos));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Tile3D from '../tile-3d';
|
|
2
2
|
import { FrameState } from './frame-state';
|
|
3
3
|
/**
|
|
4
4
|
* For the maxScreenThreshold error metric, maxError means that you should replace the node with it's children
|
|
@@ -17,3 +17,4 @@ export declare function getLodStatus(tile: Tile3D, frameState: FrameState): 'DIG
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
export declare function getProjectedRadius(tile: Tile3D, frameState: FrameState): number;
|
|
20
|
+
//# sourceMappingURL=i3s-lod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i3s-lod.d.ts","sourceRoot":"","sources":["../../../src/tileset/helpers/i3s-lod.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,YAAY,CAAC;AAChC,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAczF;AAED;;;;;GAKG;AAEH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,MAAM,CAoD/E"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProjectedRadius = exports.getLodStatus = void 0;
|
|
4
|
+
const core_1 = require("@math.gl/core");
|
|
5
|
+
const geospatial_1 = require("@math.gl/geospatial");
|
|
6
|
+
/**
|
|
7
|
+
* For the maxScreenThreshold error metric, maxError means that you should replace the node with it's children
|
|
8
|
+
as soon as the nodes bounding sphere has a screen radius larger than maxError pixels.
|
|
9
|
+
In this sense a value of 0 means you should always load it's children,
|
|
10
|
+
or if it's a leaf node, you should always display it.
|
|
11
|
+
* @param tile
|
|
12
|
+
* @param frameState
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
function getLodStatus(tile, frameState) {
|
|
16
|
+
if (tile.lodMetricValue === 0 || isNaN(tile.lodMetricValue)) {
|
|
17
|
+
return 'DIG';
|
|
18
|
+
}
|
|
19
|
+
const screenSize = 2 * getProjectedRadius(tile, frameState);
|
|
20
|
+
if (screenSize < 2) {
|
|
21
|
+
return 'OUT';
|
|
22
|
+
}
|
|
23
|
+
if (!tile.header.children || screenSize <= tile.lodMetricValue) {
|
|
24
|
+
return 'DRAW';
|
|
25
|
+
}
|
|
26
|
+
else if (tile.header.children) {
|
|
27
|
+
return 'DIG';
|
|
28
|
+
}
|
|
29
|
+
return 'OUT';
|
|
30
|
+
}
|
|
31
|
+
exports.getLodStatus = getLodStatus;
|
|
32
|
+
/**
|
|
33
|
+
* Calculate size of MBS radius projected on the screen plane
|
|
34
|
+
* @param tile
|
|
35
|
+
* @param frameState
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
// eslint-disable-next-line max-statements
|
|
39
|
+
function getProjectedRadius(tile, frameState) {
|
|
40
|
+
const originalViewport = frameState.viewport;
|
|
41
|
+
const ViewportClass = originalViewport.constructor;
|
|
42
|
+
const { longitude, latitude, height, width, bearing, zoom } = originalViewport;
|
|
43
|
+
// @ts-ignore
|
|
44
|
+
const viewport = new ViewportClass({ longitude, latitude, height, width, bearing, zoom, pitch: 0 });
|
|
45
|
+
const mbsLat = tile.header.mbs[1];
|
|
46
|
+
const mbsLon = tile.header.mbs[0];
|
|
47
|
+
const mbsZ = tile.header.mbs[2];
|
|
48
|
+
const mbsR = tile.header.mbs[3];
|
|
49
|
+
const mbsCenterCartesian = [...tile.boundingVolume.center];
|
|
50
|
+
const cameraPositionCartographic = viewport.unprojectPosition(viewport.cameraPosition);
|
|
51
|
+
const cameraPositionCartesian = geospatial_1.Ellipsoid.WGS84.cartographicToCartesian(cameraPositionCartographic, new core_1.Vector3());
|
|
52
|
+
// ---------------------------
|
|
53
|
+
// Calculate mbs border vertex
|
|
54
|
+
// ---------------------------
|
|
55
|
+
const toEye = new core_1.Vector3(cameraPositionCartesian).subtract(mbsCenterCartesian).normalize();
|
|
56
|
+
// Add extra vector to form plane
|
|
57
|
+
const enuToCartesianMatrix = new core_1.Matrix4();
|
|
58
|
+
geospatial_1.Ellipsoid.WGS84.eastNorthUpToFixedFrame(mbsCenterCartesian, enuToCartesianMatrix);
|
|
59
|
+
const cartesianToEnuMatrix = new core_1.Matrix4(enuToCartesianMatrix).invert();
|
|
60
|
+
const cameraPositionEnu = new core_1.Vector3(cameraPositionCartesian).transform(cartesianToEnuMatrix);
|
|
61
|
+
// Mean Proportionals in Right Triangles - Altitude rule
|
|
62
|
+
// https://mathbitsnotebook.com/Geometry/RightTriangles/RTmeanRight.html
|
|
63
|
+
const projection = Math.sqrt(cameraPositionEnu[0] * cameraPositionEnu[0] + cameraPositionEnu[1] * cameraPositionEnu[1]);
|
|
64
|
+
const extraZ = (projection * projection) / cameraPositionEnu[2];
|
|
65
|
+
const extraVertexEnu = new core_1.Vector3([cameraPositionEnu[0], cameraPositionEnu[1], extraZ]);
|
|
66
|
+
const extraVertexCartesian = extraVertexEnu.transform(enuToCartesianMatrix);
|
|
67
|
+
const extraVectorCartesian = new core_1.Vector3(extraVertexCartesian)
|
|
68
|
+
.subtract(mbsCenterCartesian)
|
|
69
|
+
.normalize();
|
|
70
|
+
// We need radius vector orthogonal to toEye vector
|
|
71
|
+
const radiusVector = toEye.cross(extraVectorCartesian).normalize().scale(mbsR);
|
|
72
|
+
const sphereMbsBorderVertexCartesian = new core_1.Vector3(mbsCenterCartesian).add(radiusVector);
|
|
73
|
+
const sphereMbsBorderVertexCartographic = geospatial_1.Ellipsoid.WGS84.cartesianToCartographic(sphereMbsBorderVertexCartesian);
|
|
74
|
+
// ---------------------------
|
|
75
|
+
// Project center vertex and border vertex and calculate projected radius of MBS
|
|
76
|
+
const projectedOrigin = viewport.project([mbsLon, mbsLat, mbsZ]);
|
|
77
|
+
const projectedMbsBorderVertex = viewport.project(sphereMbsBorderVertexCartographic);
|
|
78
|
+
const projectedRadius = new core_1.Vector3(projectedOrigin)
|
|
79
|
+
.subtract(projectedMbsBorderVertex)
|
|
80
|
+
.magnitude();
|
|
81
|
+
return projectedRadius;
|
|
82
|
+
}
|
|
83
|
+
exports.getProjectedRadius = getProjectedRadius;
|
|
@@ -5,3 +5,4 @@ export declare function calculateDynamicScreenSpaceError(root: any, { camera, ma
|
|
|
5
5
|
export declare function fog(distanceToCamera: any, density: any): number;
|
|
6
6
|
export declare function getDynamicScreenSpaceError(tileset: any, distanceToCamera: any): number;
|
|
7
7
|
export declare function getTiles3DScreenSpaceError(tile: any, frameState: any, useParentLodMetric: any): number;
|
|
8
|
+
//# sourceMappingURL=tiles-3d-lod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tiles-3d-lod.d.ts","sourceRoot":"","sources":["../../../src/tileset/helpers/tiles-3d-lod.ts"],"names":[],"mappings":"AAkBA,wBAAgB,gCAAgC,CAAC,IAAI,KAAA,EAAE,EAAC,MAAM,EAAE,aAAa,EAAC;;;CAAA,EAAE,OAAO,KAAK,UAqF3F;AAED,wBAAgB,GAAG,CAAC,gBAAgB,KAAA,EAAE,OAAO,KAAA,UAG5C;AAED,wBAAgB,0BAA0B,CAAC,OAAO,KAAA,EAAE,gBAAgB,KAAA,UAUnE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,KAAA,EAAE,UAAU,KAAA,EAAE,kBAAkB,KAAA,UAsB9E"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file is derived from the Cesium code base under Apache 2 license
|
|
3
|
+
// See LICENSE.md and https://github.com/AnalyticalGraphicsInc/cesium/blob/master/LICENSE.md
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.getTiles3DScreenSpaceError = exports.getDynamicScreenSpaceError = exports.fog = exports.calculateDynamicScreenSpaceError = void 0;
|
|
6
|
+
// TODO - Dynamic screen space error provides an optimization when looking at
|
|
7
|
+
// tilesets from above
|
|
8
|
+
/* eslint-disable */
|
|
9
|
+
// @ts-nocheck
|
|
10
|
+
const core_1 = require("@math.gl/core");
|
|
11
|
+
const scratchPositionNormal = new core_1.Vector3();
|
|
12
|
+
const scratchCartographic = new core_1.Vector3();
|
|
13
|
+
const scratchMatrix = new core_1.Matrix4();
|
|
14
|
+
const scratchCenter = new core_1.Vector3();
|
|
15
|
+
const scratchPosition = new core_1.Vector3();
|
|
16
|
+
const scratchDirection = new core_1.Vector3();
|
|
17
|
+
// eslint-disable-next-line max-statements, complexity
|
|
18
|
+
function calculateDynamicScreenSpaceError(root, { camera, mapProjection }, options = {}) {
|
|
19
|
+
const { dynamicScreenSpaceErrorHeightFalloff = 0.25, dynamicScreenSpaceErrorDensity = 0.00278 } = options;
|
|
20
|
+
let up;
|
|
21
|
+
let direction;
|
|
22
|
+
let height;
|
|
23
|
+
let minimumHeight;
|
|
24
|
+
let maximumHeight;
|
|
25
|
+
const tileBoundingVolume = root.contentBoundingVolume;
|
|
26
|
+
if (tileBoundingVolume instanceof TileBoundingRegion) {
|
|
27
|
+
up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);
|
|
28
|
+
direction = camera.directionWC;
|
|
29
|
+
height = camera.positionCartographic.height;
|
|
30
|
+
minimumHeight = tileBoundingVolume.minimumHeight;
|
|
31
|
+
maximumHeight = tileBoundingVolume.maximumHeight;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
// Transform camera position and direction into the local coordinate system of the tileset
|
|
35
|
+
const transformLocal = core_1.Matrix4.inverseTransformation(root.computedTransform, scratchMatrix);
|
|
36
|
+
const ellipsoid = mapProjection.ellipsoid;
|
|
37
|
+
const boundingVolume = tileBoundingVolume.boundingVolume;
|
|
38
|
+
const centerLocal = core_1.Matrix4.multiplyByPoint(transformLocal, boundingVolume.center, scratchCenter);
|
|
39
|
+
if (Cartesian3.magnitude(centerLocal) > ellipsoid.minimumRadius) {
|
|
40
|
+
// The tileset is defined in WGS84. Approximate the minimum and maximum height.
|
|
41
|
+
const centerCartographic = Cartographic.fromCartesian(centerLocal, ellipsoid, scratchCartographic);
|
|
42
|
+
up = Cartesian3.normalize(camera.positionWC, scratchPositionNormal);
|
|
43
|
+
direction = camera.directionWC;
|
|
44
|
+
height = camera.positionCartographic.height;
|
|
45
|
+
minimumHeight = 0.0;
|
|
46
|
+
maximumHeight = centerCartographic.height * 2.0;
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
// The tileset is defined in local coordinates (z-up)
|
|
50
|
+
const positionLocal = core_1.Matrix4.multiplyByPoint(transformLocal, camera.positionWC, scratchPosition);
|
|
51
|
+
up = Cartesian3.UNIT_Z;
|
|
52
|
+
direction = core_1.Matrix4.multiplyByPointAsVector(transformLocal, camera.directionWC, scratchDirection);
|
|
53
|
+
direction = Cartesian3.normalize(direction, direction);
|
|
54
|
+
height = positionLocal.z;
|
|
55
|
+
if (tileBoundingVolume instanceof TileOrientedBoundingBox) {
|
|
56
|
+
// Assuming z-up, the last component stores the half-height of the box
|
|
57
|
+
const boxHeight = root._header.boundingVolume.box[11];
|
|
58
|
+
minimumHeight = centerLocal.z - boxHeight;
|
|
59
|
+
maximumHeight = centerLocal.z + boxHeight;
|
|
60
|
+
}
|
|
61
|
+
else if (tileBoundingVolume instanceof TileBoundingSphere) {
|
|
62
|
+
const radius = boundingVolume.radius;
|
|
63
|
+
minimumHeight = centerLocal.z - radius;
|
|
64
|
+
maximumHeight = centerLocal.z + radius;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// The range where the density starts to lessen. Start at the quarter height of the tileset.
|
|
69
|
+
const heightFalloff = dynamicScreenSpaceErrorHeightFalloff;
|
|
70
|
+
const heightClose = minimumHeight + (maximumHeight - minimumHeight) * heightFalloff;
|
|
71
|
+
const heightFar = maximumHeight;
|
|
72
|
+
const t = (0, core_1.clamp)((height - heightClose) / (heightFar - heightClose), 0.0, 1.0);
|
|
73
|
+
// Increase density as the camera tilts towards the horizon
|
|
74
|
+
const dot = Math.abs(Cartesian3.dot(direction, up));
|
|
75
|
+
let horizonFactor = 1.0 - dot;
|
|
76
|
+
// Weaken the horizon factor as the camera height increases, implying the camera is further away from the tileset.
|
|
77
|
+
// The goal is to increase density for the "street view", not when viewing the tileset from a distance.
|
|
78
|
+
horizonFactor = horizonFactor * (1.0 - t);
|
|
79
|
+
return dynamicScreenSpaceErrorDensity * horizonFactor;
|
|
80
|
+
}
|
|
81
|
+
exports.calculateDynamicScreenSpaceError = calculateDynamicScreenSpaceError;
|
|
82
|
+
function fog(distanceToCamera, density) {
|
|
83
|
+
const scalar = distanceToCamera * density;
|
|
84
|
+
return 1.0 - Math.exp(-(scalar * scalar));
|
|
85
|
+
}
|
|
86
|
+
exports.fog = fog;
|
|
87
|
+
function getDynamicScreenSpaceError(tileset, distanceToCamera) {
|
|
88
|
+
if (tileset.dynamicScreenSpaceError && tileset.dynamicScreenSpaceErrorComputedDensity) {
|
|
89
|
+
const density = tileset.dynamicScreenSpaceErrorComputedDensity;
|
|
90
|
+
const factor = tileset.dynamicScreenSpaceErrorFactor;
|
|
91
|
+
// TODO: Refined screen space error that minimizes tiles in non-first-person
|
|
92
|
+
const dynamicError = fog(distanceToCamera, density) * factor;
|
|
93
|
+
return dynamicError;
|
|
94
|
+
}
|
|
95
|
+
return 0;
|
|
96
|
+
}
|
|
97
|
+
exports.getDynamicScreenSpaceError = getDynamicScreenSpaceError;
|
|
98
|
+
function getTiles3DScreenSpaceError(tile, frameState, useParentLodMetric) {
|
|
99
|
+
const tileset = tile.tileset;
|
|
100
|
+
const parentLodMetricValue = (tile.parent && tile.parent.lodMetricValue) || tile.lodMetricValue;
|
|
101
|
+
const lodMetricValue = useParentLodMetric ? parentLodMetricValue : tile.lodMetricValue;
|
|
102
|
+
// Leaf tiles do not have any error so save the computation
|
|
103
|
+
if (lodMetricValue === 0.0) {
|
|
104
|
+
return 0.0;
|
|
105
|
+
}
|
|
106
|
+
// TODO: Orthographic Frustum needs special treatment?
|
|
107
|
+
// this._getOrthograhicScreenSpaceError();
|
|
108
|
+
// Avoid divide by zero when viewer is inside the tile
|
|
109
|
+
const distance = Math.max(tile._distanceToCamera, 1e-7);
|
|
110
|
+
const { height, sseDenominator } = frameState;
|
|
111
|
+
const { viewDistanceScale } = tileset.options;
|
|
112
|
+
let error = (lodMetricValue * height * (viewDistanceScale || 1.0)) / (distance * sseDenominator);
|
|
113
|
+
error -= getDynamicScreenSpaceError(tileset, distance);
|
|
114
|
+
return error;
|
|
115
|
+
}
|
|
116
|
+
exports.getTiles3DScreenSpaceError = getTiles3DScreenSpaceError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-utils.d.ts","sourceRoot":"","sources":["../../../src/tileset/helpers/transform-utils.ts"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,CAAC,UAAU,KAAA,EAAE,IAAI,KAAA,QA4DvD"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.calculateTransformProps = void 0;
|
|
4
|
+
const geospatial_1 = require("@math.gl/geospatial");
|
|
5
|
+
const core_1 = require("@math.gl/core");
|
|
6
|
+
const loader_utils_1 = require("@loaders.gl/loader-utils");
|
|
7
|
+
function calculateTransformProps(tileHeader, tile) {
|
|
8
|
+
(0, loader_utils_1.assert)(tileHeader);
|
|
9
|
+
(0, loader_utils_1.assert)(tile);
|
|
10
|
+
const { rtcCenter, gltfUpAxis } = tile;
|
|
11
|
+
const { computedTransform, boundingVolume: { center } } = tileHeader;
|
|
12
|
+
let modelMatrix = new core_1.Matrix4(computedTransform);
|
|
13
|
+
// Translate if appropriate
|
|
14
|
+
if (rtcCenter) {
|
|
15
|
+
modelMatrix.translate(rtcCenter);
|
|
16
|
+
}
|
|
17
|
+
// glTF models need to be rotated from Y to Z up
|
|
18
|
+
// https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#y-up-to-z-up
|
|
19
|
+
switch (gltfUpAxis) {
|
|
20
|
+
case 'Z':
|
|
21
|
+
break;
|
|
22
|
+
case 'Y':
|
|
23
|
+
const rotationY = new core_1.Matrix4().rotateX(Math.PI / 2);
|
|
24
|
+
modelMatrix = modelMatrix.multiplyRight(rotationY);
|
|
25
|
+
break;
|
|
26
|
+
case 'X':
|
|
27
|
+
const rotationX = new core_1.Matrix4().rotateY(-Math.PI / 2);
|
|
28
|
+
modelMatrix = modelMatrix.multiplyRight(rotationX);
|
|
29
|
+
break;
|
|
30
|
+
default:
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
// Scale/offset positions if normalized integers
|
|
34
|
+
if (tile.isQuantized) {
|
|
35
|
+
modelMatrix.translate(tile.quantizedVolumeOffset).scale(tile.quantizedVolumeScale);
|
|
36
|
+
}
|
|
37
|
+
// Option 1: Cartesian matrix and origin
|
|
38
|
+
const cartesianOrigin = new core_1.Vector3(center);
|
|
39
|
+
tile.cartesianModelMatrix = modelMatrix;
|
|
40
|
+
tile.cartesianOrigin = cartesianOrigin;
|
|
41
|
+
// Option 2: Cartographic matrix and origin
|
|
42
|
+
const cartographicOrigin = geospatial_1.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new core_1.Vector3());
|
|
43
|
+
const fromFixedFrameMatrix = geospatial_1.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin);
|
|
44
|
+
const toFixedFrameMatrix = fromFixedFrameMatrix.invert();
|
|
45
|
+
tile.cartographicModelMatrix = toFixedFrameMatrix.multiplyRight(modelMatrix);
|
|
46
|
+
tile.cartographicOrigin = cartographicOrigin;
|
|
47
|
+
// Deprecated, drop
|
|
48
|
+
if (!tile.coordinateSystem) {
|
|
49
|
+
tile.modelMatrix = tile.cartographicModelMatrix;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.calculateTransformProps = calculateTransformProps;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom.d.ts","sourceRoot":"","sources":["../../../src/tileset/helpers/zoom.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,cAAc,KAAA,UAoBvD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getZoomFromBoundingVolume = void 0;
|
|
4
|
+
const core_1 = require("@math.gl/core");
|
|
5
|
+
const WGS84_RADIUS_X = 6378137.0;
|
|
6
|
+
const WGS84_RADIUS_Y = 6378137.0;
|
|
7
|
+
const WGS84_RADIUS_Z = 6356752.3142451793;
|
|
8
|
+
const scratchVector = new core_1.Vector3();
|
|
9
|
+
/**
|
|
10
|
+
* Calculate appropriate zoom value for a particular boundingVolume
|
|
11
|
+
* @param {BoundingSphere, OrientedBoundingBox} boundingVolume - the instance of bounding volume
|
|
12
|
+
* @returns {number} - zoom value
|
|
13
|
+
*/
|
|
14
|
+
function getZoomFromBoundingVolume(boundingVolume) {
|
|
15
|
+
const { halfAxes, radius, width, height } = boundingVolume;
|
|
16
|
+
if (halfAxes) {
|
|
17
|
+
// OrientedBoundingBox
|
|
18
|
+
const obbSize = getObbSize(halfAxes);
|
|
19
|
+
// Use WGS84_RADIUS_Z to allign with BoundingSphere algorithm
|
|
20
|
+
return Math.log2(WGS84_RADIUS_Z / obbSize);
|
|
21
|
+
}
|
|
22
|
+
else if (radius) {
|
|
23
|
+
// BoundingSphere
|
|
24
|
+
return Math.log2(WGS84_RADIUS_Z / radius);
|
|
25
|
+
}
|
|
26
|
+
else if (height && width) {
|
|
27
|
+
// BoundingRectangle
|
|
28
|
+
const zoomX = Math.log2(WGS84_RADIUS_X / width);
|
|
29
|
+
const zoomY = Math.log2(WGS84_RADIUS_Y / height);
|
|
30
|
+
return (zoomX + zoomY) / 2;
|
|
31
|
+
}
|
|
32
|
+
return 1;
|
|
33
|
+
}
|
|
34
|
+
exports.getZoomFromBoundingVolume = getZoomFromBoundingVolume;
|
|
35
|
+
function getObbSize(halfAxes) {
|
|
36
|
+
halfAxes.getColumn(0, scratchVector);
|
|
37
|
+
const axeY = halfAxes.getColumn(1);
|
|
38
|
+
const axeZ = halfAxes.getColumn(2);
|
|
39
|
+
const farthestVertex = scratchVector.add(axeY).add(axeZ);
|
|
40
|
+
const size = farthestVertex.len();
|
|
41
|
+
return size;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tile-3d.d.ts","sourceRoot":"","sources":["../../src/tileset/tile-3d.ts"],"names":[],"mappings":"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"}
|