itowns 2.43.2-next.13 → 2.43.2-next.15
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/itowns.js +1 -1
- package/dist/itowns.js.map +1 -1
- package/examples/potree2_25d_map.html +1 -1
- package/lib/Core/Potree2Node.js +6 -1
- package/lib/Layer/C3DTilesLayer.js +4 -4
- package/lib/Layer/ReferencingLayerProperties.js +5 -0
- package/lib/Process/3dTilesProcessing.js +2 -1
- package/lib/Provider/3dTilesProvider.js +1 -1
- package/package.json +1 -1
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
potreeLayer = new itowns.Potree2Layer('Lion', {
|
|
64
64
|
source: new itowns.Potree2Source({
|
|
65
65
|
file: 'metadata.json',
|
|
66
|
-
url: 'https://
|
|
66
|
+
url: 'https://raw.githubusercontent.com/iTowns/iTowns2-sample-data/master/pointclouds/potree2.0/lion',
|
|
67
67
|
crs: view.referenceCrs,
|
|
68
68
|
}),
|
|
69
69
|
});
|
package/lib/Core/Potree2Node.js
CHANGED
|
@@ -105,11 +105,16 @@ class Potree2Node extends PointCloudNode {
|
|
|
105
105
|
}
|
|
106
106
|
networkOptions(byteOffset, byteSize) {
|
|
107
107
|
const first = byteOffset;
|
|
108
|
+
// When we specify 'multipart/byteranges' on headers request it trigger a preflight request
|
|
109
|
+
// Actually github doesn't support it https://github.com/orgs/community/discussions/24659
|
|
110
|
+
// But if we omit header parameter, github seems to know it's a 'multipart/byteranges' request (thanks to 'Range' parameter)
|
|
108
111
|
const networkOptions = {
|
|
109
112
|
...this.layer.source.networkOptions,
|
|
110
113
|
headers: {
|
|
111
114
|
...this.layer.source.networkOptions.headers,
|
|
112
|
-
'
|
|
115
|
+
...(this.url.startsWith('https://raw.githubusercontent.com') ? {} : {
|
|
116
|
+
'content-type': 'multipart/byteranges'
|
|
117
|
+
}),
|
|
113
118
|
Range: `bytes=${first}-${first + byteSize - 1n}`
|
|
114
119
|
}
|
|
115
120
|
};
|
|
@@ -116,8 +116,8 @@ class C3DTilesLayer extends GeometryLayer {
|
|
|
116
116
|
this.pntsShape = PNTS_SHAPE.CIRCLE;
|
|
117
117
|
this.classification = config.classification;
|
|
118
118
|
this.pntsSizeMode = PNTS_SIZE_MODE.VALUE;
|
|
119
|
-
this.pntsMinAttenuatedSize = config.pntsMinAttenuatedSize ||
|
|
120
|
-
this.pntsMaxAttenuatedSize = config.pntsMaxAttenuatedSize ||
|
|
119
|
+
this.pntsMinAttenuatedSize = config.pntsMinAttenuatedSize || 1;
|
|
120
|
+
this.pntsMaxAttenuatedSize = config.pntsMaxAttenuatedSize || 7;
|
|
121
121
|
if (config.pntsMode) {
|
|
122
122
|
const exists = Object.values(PNTS_MODE).includes(config.pntsMode);
|
|
123
123
|
if (!exists) {
|
|
@@ -186,8 +186,8 @@ class C3DTilesLayer extends GeometryLayer {
|
|
|
186
186
|
init3dTilesLayer(view, view.mainLoop.scheduler, this, tileset.root).then(resolve);
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
|
-
preUpdate() {
|
|
190
|
-
return pre3dTilesUpdate.bind(this)();
|
|
189
|
+
preUpdate(context) {
|
|
190
|
+
return pre3dTilesUpdate.bind(this)(context);
|
|
191
191
|
}
|
|
192
192
|
update(context, layer, node) {
|
|
193
193
|
return update(context, layer, node);
|
|
@@ -38,6 +38,11 @@ function ReferLayerProperties(material, layer) {
|
|
|
38
38
|
get: () => material.layer.pntsMaxAttenuatedSize
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
+
if (material.uniforms && material.uniforms.scale != undefined) {
|
|
42
|
+
Object.defineProperty(material.uniforms.scale, 'value', {
|
|
43
|
+
get: () => material.layer.scale
|
|
44
|
+
});
|
|
45
|
+
}
|
|
41
46
|
Object.defineProperty(material, 'wireframe', {
|
|
42
47
|
get: () => material.layer.wireframe
|
|
43
48
|
});
|
|
@@ -160,10 +160,11 @@ function cleanup3dTileset(layer, n) {
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// this is a layer
|
|
163
|
-
export function pre3dTilesUpdate() {
|
|
163
|
+
export function pre3dTilesUpdate(context) {
|
|
164
164
|
if (!this.visible) {
|
|
165
165
|
return [];
|
|
166
166
|
}
|
|
167
|
+
this.scale = context.camera._preSSE;
|
|
167
168
|
|
|
168
169
|
// Elements removed are added in the layer._cleanableTiles list.
|
|
169
170
|
// Since we simply push in this array, the first item is always
|
|
@@ -35,7 +35,7 @@ function gltfToMesh(data, layer, url) {
|
|
|
35
35
|
function pntsParse(data, layer) {
|
|
36
36
|
return PntsParser.parse(data, layer.registeredExtensions).then(result => {
|
|
37
37
|
const material = layer.material ? layer.material.clone() : new PointsMaterial({
|
|
38
|
-
size:
|
|
38
|
+
size: 1,
|
|
39
39
|
mode: layer.pntsMode,
|
|
40
40
|
shape: layer.pntsShape,
|
|
41
41
|
classification: layer.classification,
|