Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
HARP-14495: Updates three to version 0.126.0
Browse files Browse the repository at this point in the history
Signed-off-by: German Zargaryan <2526045+germanz@users.noreply.github.com>
  • Loading branch information
germanz committed Mar 11, 2021
1 parent 5529fb2 commit ee8a918
Show file tree
Hide file tree
Showing 26 changed files with 68 additions and 44 deletions.
7 changes: 3 additions & 4 deletions @here/harp-datasource-protocol/lib/ThreeBufferUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import {
BufferAttribute as ThreeBufferAttribute,
BufferGeometry as ThreeBufferGeometry,
InterleavedBufferAttribute as ThreeInterleavedBufferAttribute,
TypedArray
InterleavedBufferAttribute as ThreeInterleavedBufferAttribute
} from "three";

import {
Expand All @@ -26,7 +25,7 @@ import {
* See also [[CustomDatasourceExample]].
*/
export namespace ThreeBufferUtils {
export function getBufferElementType(buffer: TypedArray): BufferElementType {
export function getBufferElementType(buffer: ArrayBufferView): BufferElementType {
if (buffer instanceof Int8Array) {
return "int8";
} else if (buffer instanceof Uint8Array) {
Expand All @@ -49,7 +48,7 @@ export namespace ThreeBufferUtils {
export function fromThreeBufferAttribute(
bufferAttribute: ThreeBufferAttribute
): BufferAttribute {
const buffer = (bufferAttribute.array as any) as TypedArray;
const buffer = (bufferAttribute.array as any) as ArrayBufferView;
return {
name: bufferAttribute.name,
buffer: buffer.buffer,
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-datasource-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
"@here/harp-test-utils": "^0.23.0",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"ts-json-schema-generator": "^0.68.1",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-debug-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"source-map-support": "^0.5.19",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@here/harp-webtile-datasource": "^0.23.0",
"@types/dat.gui": "^0.7.1",
"@types/long": "^4.0.1",
"@types/three": "^0.126.0",
"copy-webpack-plugin": "^7.0.0",
"cross-env": "^7.0.2",
"css-loader": "^5.0.1",
Expand All @@ -53,7 +54,7 @@
"stats.js": "^0.17.0",
"style-loader": "^2.0.0",
"suncalc": "^1.8.0",
"three": "^0.125.0",
"three": "^0.126.0",
"ts-loader": "^8.0.7",
"typescript": "^4.1.2",
"webpack": "^5.12.3",
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-features-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
Expand All @@ -37,7 +38,7 @@
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-geojson-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"publishConfig": {
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-geometry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"earcut": "^2.2.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"dependencies": {
"@here/harp-geoutils": "^0.23.0",
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-geoutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-lines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@
"@here/harp-utils": "^0.23.0",
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-map-controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,17 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-mapview/lib/DecodedTileHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function createMaterial(
}

if (isExtrudedPolygonTechnique(technique)) {
material.flatShading = true;
(material as MapMeshStandardMaterial).flatShading = true;
}

material.depthTest = isExtrudedPolygonTechnique(technique) && technique.depthTest !== false;
Expand Down Expand Up @@ -838,7 +838,7 @@ function getBaseColorPropName(technique: Technique): string | undefined {
function getTextureBuffer(
buffer: ArrayBuffer,
textureDataType: THREE.TextureDataType | undefined
): THREE.TypedArray {
): BufferSource {
if (textureDataType === undefined) {
return new Uint8Array(buffer);
}
Expand Down
9 changes: 5 additions & 4 deletions @here/harp-mapview/lib/TileObjectsRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
MapEnv,
Pickability
} from "@here/harp-datasource-protocol";
import { Object3D, Vector3 } from "three";

import { BackgroundDataSource } from "./BackgroundDataSource";
import { SolidLineMesh } from "./geometry/SolidLineMesh";
Expand Down Expand Up @@ -44,8 +43,8 @@ export class TileObjectRenderer {
tile: Tile,
storageLevel: number,
zoomLevel: number,
cameraPosition: Vector3,
rootNode: Object3D
cameraPosition: THREE.Vector3,
rootNode: THREE.Object3D
) {
const worldOffsetX = tile.computeWorldOffsetX();
if (tile.willRender(storageLevel)) {
Expand Down Expand Up @@ -157,7 +156,9 @@ export class TileObjectRenderer {
return stableSort(a, b);
};

this.m_renderer.setOpaqueSort(painterSortStable);
// Temporary workaround due to incorrect comparator type definition:
// https://github.com/three-types/three-ts-types/issues/41
this.m_renderer.setOpaqueSort((painterSortStable as any) as () => void);
}

private updateStencilRef(object: TileObject) {
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-mapview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,19 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"chai-as-promised": "^7.1.1",
"copyfiles": "^2.2.0",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
1 change: 0 additions & 1 deletion @here/harp-materials/lib/MapMeshMaterials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,6 @@ export class MapMeshDepthMaterial extends THREE.MeshDepthMaterial implements Ext
// outputs of the vertex shader not used in the pixel shader, the properties in question
// are `vExtrusionRatio` and `vExtrusionAxis`.
this.applyExtrusionParameters({ ...params, zFightingWorkaround: false });
this.flatShading = false;
}

// Only here to make the compiler happy, these methods will be overriden: The actual
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-materials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-omv-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"copyfiles": "^2.2.0",
"cross-env": "^7.0.2",
Expand All @@ -47,7 +48,7 @@
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"glob": "^7.1.3",
"pixelmatch": "^5.2.0",
"sinon": "^9.2.2",
"three": "^0.125.0",
"three": "^0.126.0",
"ua-parser-js": "^0.7.21",
"xml2js": "^0.4.23"
},
Expand All @@ -42,6 +42,7 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/serve-static": "^1.13.4",
"@types/three": "^0.126.0",
"body-parser": "^1.18.3",
"cross-env": "^7.0.2",
"express": "^4.17.1",
Expand Down
5 changes: 3 additions & 2 deletions @here/harp-text-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"cross-env": "^7.0.2",
"mocha": "^8.2.1",
"sinon": "^9.2.2",
"source-map-support": "^0.5.19",
"three": "^0.125.0",
"three": "^0.126.0",
"ts-node": "^9.1.1",
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-vectortile-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@types/mocha": "^8.2.0",
"@types/node": "^14.0.5",
"@types/sinon": "^9.0.10",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"copyfiles": "^2.2.0",
"cross-env": "^7.0.2",
Expand All @@ -61,7 +62,7 @@
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp-webtile-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"devDependencies": {
"@types/chai": "^4.2.14",
"@types/mocha": "^8.2.0",
"@types/three": "^0.126.0",
"chai": "^4.0.2",
"copyfiles": "^2.2.0",
"cross-env": "^7.0.2",
Expand All @@ -41,7 +42,7 @@
"typescript": "^4.1.2"
},
"peerDependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"publishConfig": {
"access": "public"
Expand Down
3 changes: 2 additions & 1 deletion @here/harp.gl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"license": "Apache-2.0",
"dependencies": {
"three": "^0.125.0"
"three": "^0.126.0"
},
"devDependencies": {
"@here/harp-datasource-protocol": "^0.23.0",
Expand All @@ -53,6 +53,7 @@
"@here/harp-vectortile-datasource": "^0.23.0",
"@here/harp-webtile-datasource": "^0.23.0",
"@microsoft/api-extractor": "^7.8.10",
"@types/three": "^0.126.0",
"ts-loader": "^8.0.7",
"typescript": "^4.1.2",
"webpack": "^5.12.3",
Expand Down
Loading

0 comments on commit ee8a918

Please sign in to comment.