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

Commit

Permalink
HARP-13367: Update Three JS (0.123.0) (#2010)
Browse files Browse the repository at this point in the history
Signed-off-by: German Zargaryan <german.zargaryan@here.com>
  • Loading branch information
German Zargaryan committed Dec 10, 2020
1 parent df73a5e commit 75e1be5
Show file tree
Hide file tree
Showing 30 changed files with 56 additions and 44 deletions.
4 changes: 2 additions & 2 deletions @here/harp-datasource-protocol/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
"cross-env": "^7.0.2",
"mocha": "^7.2.0",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"ts-json-schema-generator": "^0.68.1",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-debug-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"stats.js": "^0.17.0",
"style-loader": "^1.2.1",
"suncalc": "^1.8.0",
"three": "^0.122.0",
"three": "^0.123.0",
"ts-loader": "^8.0.7",
"typescript": "^3.9.3",
"webpack-cli": "^4.2.0",
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-features-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-geojson-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"publishConfig": {
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-geometry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"dependencies": {
"@here/harp-geoutils": "^0.21.0",
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-geoutils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-lines/lib/HighPrecisionLines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class HighPrecisionWireFrameLine extends THREE.Line implements HighPrecis
super.updateMatrixWorld(force);

if (doUpdateMatrixWorldInverse) {
this.matrixWorldInverse.getInverse(this.matrixWorld);
this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
}
}
Expand Down Expand Up @@ -162,7 +162,7 @@ export class HighPrecisionLine extends THREE.Mesh implements HighPrecisionObject
super.updateMatrixWorld(force);

if (doUpdateMatrixWorldInverse) {
this.matrixWorldInverse.getInverse(this.matrixWorld);
this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
}
}
2 changes: 1 addition & 1 deletion @here/harp-lines/lib/HighPrecisionPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class HighPrecisionPoints extends THREE.Points implements HighPrecisionOb
super.updateMatrixWorld(force);

if (doUpdateMatrixWorldInverse) {
this.matrixWorldInverse.getInverse(this.matrixWorld);
this.matrixWorldInverse.copy(this.matrixWorld).invert();
}
}
}
4 changes: 2 additions & 2 deletions @here/harp-lines/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
"cross-env": "^7.0.2",
"mocha": "^7.2.0",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-map-controls/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 4 additions & 1 deletion @here/harp-mapview/lib/MapView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3033,7 +3033,10 @@ export class MapView extends EventDispatcher {
tangentSpaceMatrix.makeBasis(transform.xAxis, transform.yAxis, transform.zAxis);

// 2. Change the basis of matrixWorld to the tangent space to get the new base axes.
cache.matrix4[0].getInverse(tangentSpaceMatrix).multiply(camera.matrixWorld);
cache.matrix4[0]
.copy(tangentSpaceMatrix)
.invert()
.multiply(camera.matrixWorld);
transform.xAxis.setFromMatrixColumn(cache.matrix4[0], 0);
transform.yAxis.setFromMatrixColumn(cache.matrix4[0], 1);
transform.zAxis.setFromMatrixColumn(cache.matrix4[0], 2);
Expand Down
9 changes: 6 additions & 3 deletions @here/harp-mapview/lib/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ export namespace MapViewUtils {
// and takes the current rotation of the camera into account.
cache.matrix4[1].multiplyMatrices(
cache.matrix4[0],
cache.matrix4[1].getInverse(mapView.camera.projectionMatrix)
cache.matrix4[1].copy(mapView.camera.projectionMatrix).invert()
);
// Unproject the point via the unprojection matrix.
const pointInCameraSpace = pointInNDCPosition.applyMatrix4(cache.matrix4[1]);
Expand Down Expand Up @@ -1141,7 +1141,7 @@ export namespace MapViewUtils {
) {
cache.quaternions[0]
.setFromUnitVectors(fromWorld.normalize(), toWorld.normalize())
.inverse();
.invert();
cache.matrix4[0].makeRotationFromQuaternion(cache.quaternions[0]);
mapView.camera.applyMatrix4(cache.matrix4[0]);
mapView.camera.updateMatrixWorld();
Expand Down Expand Up @@ -1326,7 +1326,10 @@ export namespace MapViewUtils {
cache.matrix4[1].makeBasis(tangentSpace.x, tangentSpace.y, tangentSpace.z);

// 2. Change the basis of matrixWorld to the tangent space to get the new base axes.
cache.matrix4[0].getInverse(cache.matrix4[1]).multiply(object.matrixWorld);
cache.matrix4[0]
.copy(cache.matrix4[1])
.invert()
.multiply(object.matrixWorld);
space.x.setFromMatrixColumn(cache.matrix4[0], 0);
space.y.setFromMatrixColumn(cache.matrix4[0], 1);
space.z.setFromMatrixColumn(cache.matrix4[0], 2);
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-mapview/lib/geometry/SolidLineMesh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export class SolidLineMesh extends THREE.Mesh {
assert(geometry.index !== null, "Geometry does not have indices");
const matrixWorld = mesh.matrixWorld;

tmpInverseMatrix.getInverse(matrixWorld);
tmpInverseMatrix.copy(matrixWorld).invert();
const localRay = tmpRay.copy(raycaster.ray).applyMatrix4(tmpInverseMatrix);

// Test intersection of ray with each of the features within the mesh.
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-mapview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-mapview/test/SolidLineMeshTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ describe("SolidLineMesh", function() {
vertex1.toArray().concat(vertex2.toArray()),
bitangent.toArray()
).build();
const localToWorld = new THREE.Matrix4().getInverse(worldToLocal);
const localToWorld = new THREE.Matrix4().copy(worldToLocal).invert();
mesh.applyMatrix4(localToWorld);
mesh.updateMatrixWorld();

Expand Down
5 changes: 4 additions & 1 deletion @here/harp-materials/lib/GroundAtmosphereMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ export class GroundAtmosphereMaterial extends RawShaderMaterial {
): { modelViewProjection: THREE.Matrix4; eyePos: THREE.Vector3; eyeHeight: number } {
if (reverse) {
const modelMatrix = new THREE.Matrix4().identity();
const viewMatrix = new THREE.Matrix4().getInverse(object.matrixWorld).transpose();
const viewMatrix = new THREE.Matrix4()
.copy(object.matrixWorld)
.invert()
.transpose();
const projectionMatrix = camera.projectionMatrix;

const mvpMatrix = new THREE.Matrix4();
Expand Down
5 changes: 4 additions & 1 deletion @here/harp-materials/lib/SkyAtmosphereMaterial.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,10 @@ export class SkyAtmosphereMaterial extends RawShaderMaterial {
): { modelViewProjection: THREE.Matrix4; eyePos: THREE.Vector3; eyeHeight: number } {
if (reverse) {
const modelMatrix = new THREE.Matrix4().identity();
const viewMatrix = new THREE.Matrix4().getInverse(object.matrixWorld).transpose();
const viewMatrix = new THREE.Matrix4()
.copy(object.matrixWorld)
.invert()
.transpose();
const projectionMatrix = camera.projectionMatrix;

const mvpMatrix = new THREE.Matrix4();
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-materials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"cross-env": "^7.0.2",
"mocha": "^7.2.0",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-omv-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 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.0.2",
"three": "^0.122.0",
"three": "^0.123.0",
"ua-parser-js": "^0.7.21",
"xml2js": "^0.4.23"
},
Expand Down
4 changes: 2 additions & 2 deletions @here/harp-text-canvas/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
"mocha": "^7.2.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.19",
"three": "^0.122.0",
"three": "^0.123.0",
"ts-node": "^8.10.1",
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-vectortile-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion @here/harp-webtile-datasource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"typescript": "^3.9.3"
},
"peerDependencies": {
"three": "^0.122.0"
"three": "^0.123.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 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.122.0"
"three": "^0.123.0"
},
"devDependencies": {
"@here/harp-datasource-protocol": "^0.21.1",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"nyc": "^15.0.1",
"prettier": "^1.19.1",
"semver": "^7.3.2",
"three": "^0.122.0",
"three": "^0.123.0",
"ts-mocha": "^7.0.0",
"typedoc": "^0.17.7",
"typescript": "^3.9.3",
Expand Down
2 changes: 1 addition & 1 deletion test/performance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@here/harp-vectortile-datasource": "^0.21.1",
"@types/chai": "^4.2.11",
"chai": "^4.2.0",
"three": "^0.122.0"
"three": "^0.123.0"
},
"license": "Apache-2.0"
}
2 changes: 1 addition & 1 deletion test/rendering/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@here/harp-vectortile-datasource": "^0.21.1",
"@types/chai": "^4.2.11",
"chai": "^4.2.0",
"three": "^0.122.0"
"three": "^0.123.0"
},
"license": "Apache-2.0"
}
2 changes: 1 addition & 1 deletion www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"mini-css-extract-plugin": "^0.9.0",
"node-fetch": "^2.6.1",
"script-ext-html-webpack-plugin": "^2.1.4",
"three": "^0.122.0",
"three": "^0.123.0",
"ts-loader": "^8.0.7",
"typescript": "^3.9.3",
"webpack": "^5.9.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9692,10 +9692,10 @@ textextensions@^2.5.0:
resolved "https://registry.yarnpkg.com/textextensions/-/textextensions-2.6.0.tgz#d7e4ab13fe54e32e08873be40d51b74229b00fc4"
integrity sha512-49WtAWS+tcsy93dRt6P0P3AMD2m5PvXRhuEA0kaXos5ZLlujtYmpmFsB+QvWUSxE1ZsstmYXfQ7L40+EcQgpAQ==

three@^0.122.0:
version "0.122.0"
resolved "https://registry.yarnpkg.com/three/-/three-0.122.0.tgz#bd9ed8a8820074856e8ba7b63fe0a65176e01aeb"
integrity sha512-bgYMo0WdaQhf7DhLE8OSNN/rVFO5J4K1A2VeeKqoV4MjjuHjfCP6xLpg8Xedhns7NlEnN3sZ6VJROq19Qyl6Sg==
three@^0.123.0:
version "0.123.0"
resolved "https://registry.yarnpkg.com/three/-/three-0.123.0.tgz#3bb6d8f908a432eb7cd450f7eab6dd40fde53085"
integrity sha512-KNnx/IbilvoHRkxOtL0ouozoDoElyuvAXhFB21RK7F5IPWSmqyFelICK6x3hJerLNSlAdHxR0hkuvMMhH9pqXg==

through2@^2.0.1, through2@~2.0.0:
version "2.0.5"
Expand Down

0 comments on commit 75e1be5

Please sign in to comment.