From 9e82ed97782083a68ef1b33d02a4903069171c9f Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 13 Jan 2023 17:50:25 +0100 Subject: [PATCH 1/9] Compatible with Three R90 --- src/navigation/Path.js | 2 +- src/navigation/Polygon.js | 4 +++- src/navigation/PoseArray.js | 3 +-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/navigation/Path.js b/src/navigation/Path.js index 2b26d0d0..29c535a1 100644 --- a/src/navigation/Path.js +++ b/src/navigation/Path.js @@ -66,9 +66,9 @@ ROS3D.Path.prototype.processMessage = function(message){ lineGeometry.vertices.push(v3); } - lineGeometry.computeLineDistances(); var lineMaterial = new THREE.LineBasicMaterial( { color: this.color } ); var line = new THREE.Line( lineGeometry, lineMaterial ); + // line.computeLineDistances(); // Only needed for LineDashedMaterial this.sn = new ROS3D.SceneNode({ frameID : message.header.frame_id, diff --git a/src/navigation/Polygon.js b/src/navigation/Polygon.js index 9c36edb1..6cdf8225 100644 --- a/src/navigation/Polygon.js +++ b/src/navigation/Polygon.js @@ -69,9 +69,11 @@ ROS3D.Polygon.prototype.processMessage = function(message){ v3 = new THREE.Vector3( message.polygon.points[0].x, message.polygon.points[0].y, message.polygon.points[0].z); lineGeometry.vertices.push(v3); - lineGeometry.computeLineDistances(); + var lineMaterial = new THREE.LineBasicMaterial( { color: this.color } ); var line = new THREE.Line( lineGeometry, lineMaterial ); + line.computeLineDistances(); + // line.computeLineDistances(); // Only needed for LineDashedMaterial this.sn = new ROS3D.SceneNode({ frameID : message.header.frame_id, diff --git a/src/navigation/PoseArray.js b/src/navigation/PoseArray.js index 1f5e7c47..952eca81 100644 --- a/src/navigation/PoseArray.js +++ b/src/navigation/PoseArray.js @@ -84,10 +84,9 @@ ROS3D.PoseArray.prototype.processMessage = function(message){ lineGeometry.vertices.push(side1.add(v3)); lineGeometry.vertices.push(side2.add(v3)); lineGeometry.vertices.push(tip); - - lineGeometry.computeLineDistances(); var lineMaterial = new THREE.LineBasicMaterial( { color: this.color } ); line = new THREE.Line( lineGeometry, lineMaterial ); + // line.computeLineDistances(); // Only needed for LineDashedMaterial group.add(line); } From 6a4fb91fe119eae7c3ca64b27d399fc4a454538b Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 13 Jan 2023 21:12:42 +0100 Subject: [PATCH 2/9] Compatible with Three R110 --- package-lock.json | 37 ++++++++---------------------------- package.json | 2 +- src/navigation/OcTreeBase.js | 6 +++--- src/sensors/NavSatFix.js | 2 +- src/sensors/Points.js | 4 ++-- 5 files changed, 15 insertions(+), 36 deletions(-) diff --git a/package-lock.json b/package-lock.json index dd5f18f4..dfa5adcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "^0.89.0" + "three": "~0.100.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", @@ -6412,20 +6412,6 @@ "node": "*" } }, - "node_modules/picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "optional": true, - "peer": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, "node_modules/pngparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pngparse/-/pngparse-2.0.1.tgz", @@ -7642,9 +7628,10 @@ "dev": true }, "node_modules/three": { - "version": "0.89.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.89.0.tgz", - "integrity": "sha512-Evv3JolLQtag/lCWu1o3cgz2E5UYCSZHbh9lfBjeLz7nlK8DMmASID680Odl++ZPYk63rrZjPAMq88IrMP3GCA==" + "version": "0.100.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.100.0.tgz", + "integrity": "sha512-/lN2rdE1OqIwJr4/HcSaOisiCY0uVA0sqPpbCG5nil2uICEdS0LfGwSVYTtZDsIpR76r3++h5H3Hzg5D+SJBRQ==", + "license": "MIT" }, "node_modules/through": { "version": "2.3.8", @@ -13419,14 +13406,6 @@ "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", "dev": true }, - "picomatch": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.2.tgz", - "integrity": "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==", - "dev": true, - "optional": true, - "peer": true - }, "pngparse": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/pngparse/-/pngparse-2.0.1.tgz", @@ -14382,9 +14361,9 @@ "dev": true }, "three": { - "version": "0.89.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.89.0.tgz", - "integrity": "sha512-Evv3JolLQtag/lCWu1o3cgz2E5UYCSZHbh9lfBjeLz7nlK8DMmASID680Odl++ZPYk63rrZjPAMq88IrMP3GCA==" + "version": "0.100.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.100.0.tgz", + "integrity": "sha512-/lN2rdE1OqIwJr4/HcSaOisiCY0uVA0sqPpbCG5nil2uICEdS0LfGwSVYTtZDsIpR76r3++h5H3Hzg5D+SJBRQ==" }, "through": { "version": "2.3.8", diff --git a/package.json b/package.json index 179f8476..30d2601d 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "^0.89.0" + "three": "~0.100.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", diff --git a/src/navigation/OcTreeBase.js b/src/navigation/OcTreeBase.js index ac4c77cf..453d576d 100644 --- a/src/navigation/OcTreeBase.js +++ b/src/navigation/OcTreeBase.js @@ -408,9 +408,9 @@ ROS3D.OcTreeBase.prototype.buildGeometry = function () { opacity: this.opacity }); - geometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3)); - geometry.addAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3)); - geometry.addAttribute('color', new THREE.BufferAttribute(new Float32Array(colors), 3)); + geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3)); + geometry.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3)); + geometry.setAttribute('color', new THREE.BufferAttribute(new Float32Array(colors), 3)); geometry.setIndex(indices); diff --git a/src/sensors/NavSatFix.js b/src/sensors/NavSatFix.js index 97be4741..ddb8f42d 100644 --- a/src/sensors/NavSatFix.js +++ b/src/sensors/NavSatFix.js @@ -37,7 +37,7 @@ ROS3D.NavSatFix = function(options) { this.geom = new THREE.BufferGeometry(); this.vertices = new THREE.BufferAttribute(new Float32Array( 6 * this.keep ), 3 ); - this.geom.addAttribute( 'position', this.vertices); + this.geom.setAttribute('position', this.vertices); this.material = material.isMaterial ? material : new THREE.LineBasicMaterial( material ); this.line = new THREE.Line( this.geom, this.material ); this.rootObject.add(this.object3d); diff --git a/src/sensors/Points.js b/src/sensors/Points.js index 36648c6e..82907c4b 100644 --- a/src/sensors/Points.js +++ b/src/sensors/Points.js @@ -57,7 +57,7 @@ ROS3D.Points.prototype.setup = function(frame, point_step, fields) this.geom = new THREE.BufferGeometry(); this.positions = new THREE.BufferAttribute( new Float32Array( this.max_pts * 3), 3, false ); - this.geom.addAttribute( 'position', this.positions.setDynamic(true) ); + this.geom.setAttribute('position', this.positions.setDynamic(true) ); if(!this.colorsrc && this.fields.rgb) { this.colorsrc = 'rgb'; @@ -66,7 +66,7 @@ ROS3D.Points.prototype.setup = function(frame, point_step, fields) var field = this.fields[this.colorsrc]; if (field) { this.colors = new THREE.BufferAttribute( new Float32Array( this.max_pts * 3), 3, false ); - this.geom.addAttribute( 'color', this.colors.setDynamic(true) ); + this.geom.setAttribute('color', this.colors.setDynamic(true) ); var offset = field.offset; this.getColor = [ function(dv,base,le){return dv.getInt8(base+offset,le);}, From 539a3f47b8aa55c6f93fa83e09c087ecc82aae67 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 13 Jan 2023 21:30:00 +0100 Subject: [PATCH 3/9] Compatible with Three R113 --- src/models/Arrow.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/Arrow.js b/src/models/Arrow.js index 9714ca0a..f12e2004 100644 --- a/src/models/Arrow.js +++ b/src/models/Arrow.js @@ -34,12 +34,12 @@ ROS3D.Arrow = function(options) { 12, 1); var m = new THREE.Matrix4(); m.setPosition(new THREE.Vector3(0, shaftLength * 0.5, 0)); - geometry.applyMatrix(m); + geometry.applyMatrix4(m); // create the head var coneGeometry = new THREE.CylinderGeometry(0, headDiameter * 0.5, headLength, 12, 1); m.setPosition(new THREE.Vector3(0, shaftLength + (headLength * 0.5), 0)); - coneGeometry.applyMatrix(m); + coneGeometry.applyMatrix4(m); // put the arrow together geometry.merge(coneGeometry); From 56700e2560c628eb47f34c914c5bf656f3d3d38d Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Fri, 13 Jan 2023 21:39:22 +0100 Subject: [PATCH 4/9] Bump Three to r113 # Conflicts: # examples/continuousmap.html # examples/depthcloud.html # examples/interactivemarkers.html # examples/kitti.html # examples/map.html # examples/markers.html # examples/navsatfix.html # examples/octree.html # examples/pointcloud2.html # package-lock.json --- examples/continuousmap.html | 4 ++-- examples/depthcloud.html | 4 ++-- examples/interactivemarkers.html | 4 ++-- examples/kitti.html | 4 ++-- examples/map.html | 2 +- examples/markers.html | 2 +- examples/navsatfix.html | 2 +- examples/octree.html | 2 +- examples/pointcloud2.html | 2 +- examples/urdf.html | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/continuousmap.html b/examples/continuousmap.html index c7cefbf9..df58ac27 100644 --- a/examples/continuousmap.html +++ b/examples/continuousmap.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/depthcloud.html b/examples/depthcloud.html index 9229f071..8e537b07 100644 --- a/examples/depthcloud.html +++ b/examples/depthcloud.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/interactivemarkers.html b/examples/interactivemarkers.html index 5d1136a2..6661efc4 100644 --- a/examples/interactivemarkers.html +++ b/examples/interactivemarkers.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/kitti.html b/examples/kitti.html index 6aafbc5b..939cbedf 100644 --- a/examples/kitti.html +++ b/examples/kitti.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/map.html b/examples/map.html index c2bbcf1b..ea763b65 100644 --- a/examples/map.html +++ b/examples/map.html @@ -3,7 +3,7 @@ - + diff --git a/examples/markers.html b/examples/markers.html index 6b0b1a9d..347cfbb5 100644 --- a/examples/markers.html +++ b/examples/markers.html @@ -3,7 +3,7 @@ - + diff --git a/examples/navsatfix.html b/examples/navsatfix.html index 8fa85078..2ae578b8 100644 --- a/examples/navsatfix.html +++ b/examples/navsatfix.html @@ -3,7 +3,7 @@ - + diff --git a/examples/octree.html b/examples/octree.html index 95b0cf7e..4fa7daa0 100644 --- a/examples/octree.html +++ b/examples/octree.html @@ -3,7 +3,7 @@ - + diff --git a/examples/pointcloud2.html b/examples/pointcloud2.html index 294c4618..7426db65 100644 --- a/examples/pointcloud2.html +++ b/examples/pointcloud2.html @@ -3,7 +3,7 @@ - + diff --git a/examples/urdf.html b/examples/urdf.html index be226865..5d8c5c0e 100644 --- a/examples/urdf.html +++ b/examples/urdf.html @@ -3,7 +3,7 @@ - + diff --git a/package-lock.json b/package-lock.json index dfa5adcc..2d5e6d74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "~0.100.0" + "three": "~0.113.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", @@ -7628,9 +7628,9 @@ "dev": true }, "node_modules/three": { - "version": "0.100.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.100.0.tgz", - "integrity": "sha512-/lN2rdE1OqIwJr4/HcSaOisiCY0uVA0sqPpbCG5nil2uICEdS0LfGwSVYTtZDsIpR76r3++h5H3Hzg5D+SJBRQ==", + "version": "0.113.2", + "resolved": "https://registry.npmjs.org/three/-/three-0.113.2.tgz", + "integrity": "sha512-x3vrKW41/UtbWbWduWKGlfIc043SvHWr3YltehYq+UGb9YglQ2oztNGvl2eut05JtNSmP11Mh3t6Xak5/0e+Fg==", "license": "MIT" }, "node_modules/through": { @@ -14361,9 +14361,9 @@ "dev": true }, "three": { - "version": "0.100.0", - "resolved": "https://registry.npmjs.org/three/-/three-0.100.0.tgz", - "integrity": "sha512-/lN2rdE1OqIwJr4/HcSaOisiCY0uVA0sqPpbCG5nil2uICEdS0LfGwSVYTtZDsIpR76r3++h5H3Hzg5D+SJBRQ==" + "version": "0.113.2", + "resolved": "https://registry.npmjs.org/three/-/three-0.113.2.tgz", + "integrity": "sha512-x3vrKW41/UtbWbWduWKGlfIc043SvHWr3YltehYq+UGb9YglQ2oztNGvl2eut05JtNSmP11Mh3t6Xak5/0e+Fg==" }, "through": { "version": "2.3.8", diff --git a/package.json b/package.json index 30d2601d..8e0f5458 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "~0.100.0" + "three": "~0.113.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", From d1ed52c1a04e5d95b6e93e70817e07dce64c3fef Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sun, 15 Jan 2023 11:51:17 +0100 Subject: [PATCH 5/9] Compatible with Three R114 --- src/models/TriangleList.js | 4 ++-- src/navigation/OcTreeBase.js | 2 +- src/sensors/Points.js | 2 +- src/visualization/SceneNode.js | 2 ++ src/visualization/interaction/Highlighter.js | 8 ++++++++ src/visualization/interaction/OrbitControls.js | 3 +++ 6 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/models/TriangleList.js b/src/models/TriangleList.js index c2138f88..557e0569 100644 --- a/src/models/TriangleList.js +++ b/src/models/TriangleList.js @@ -43,7 +43,7 @@ ROS3D.TriangleList = function(options) { } geometry.faces.push(faceVert); } - material.vertexColors = THREE.VertexColors; + material.vertexColors = true; } else if (colors.length === vertices.length / 3) { // use per-triangle color for (i = 0; i < vertices.length; i += 3) { @@ -51,7 +51,7 @@ ROS3D.TriangleList = function(options) { faceTri.color.setRGB(colors[i / 3].r, colors[i / 3].g, colors[i / 3].b); geometry.faces.push(faceTri); } - material.vertexColors = THREE.FaceColors; + material.vertexColors = true; } else { // use marker color for (i = 0; i < vertices.length; i += 3) { diff --git a/src/navigation/OcTreeBase.js b/src/navigation/OcTreeBase.js index 453d576d..2a77d388 100644 --- a/src/navigation/OcTreeBase.js +++ b/src/navigation/OcTreeBase.js @@ -403,7 +403,7 @@ ROS3D.OcTreeBase.prototype.buildGeometry = function () { const material = new THREE.MeshBasicMaterial({ color: 'white', flatShading: true, - vertexColors: THREE.VertexColors, + vertexColors: true, transparent: this.opacity < 1.0, opacity: this.opacity }); diff --git a/src/sensors/Points.js b/src/sensors/Points.js index 82907c4b..eae70a89 100644 --- a/src/sensors/Points.js +++ b/src/sensors/Points.js @@ -86,7 +86,7 @@ ROS3D.Points.prototype.setup = function(frame, point_step, fields) if(!this.material.isMaterial) { // if it is an option, apply defaults and pass it to a PointsMaterial if(this.colors && this.material.vertexColors === undefined) { - this.material.vertexColors = THREE.VertexColors; + this.material.vertexColors = true; } this.material = new THREE.PointsMaterial(this.material); } diff --git a/src/visualization/SceneNode.js b/src/visualization/SceneNode.js index 253e5f38..ac5d9937 100644 --- a/src/visualization/SceneNode.js +++ b/src/visualization/SceneNode.js @@ -25,6 +25,7 @@ ROS3D.SceneNode = function(options) { // Do not render this object until we receive a TF update this.visible = false; + this.layers.disable(0); // add the model this.add(object); @@ -43,6 +44,7 @@ ROS3D.SceneNode = function(options) { // update the world this.updatePose(poseTransformed); this.visible = true; + this.layers.enable(0); }; // listen for TF updates diff --git a/src/visualization/interaction/Highlighter.js b/src/visualization/interaction/Highlighter.js index 44541529..781f14f8 100644 --- a/src/visualization/interaction/Highlighter.js +++ b/src/visualization/interaction/Highlighter.js @@ -97,6 +97,7 @@ ROS3D.Highlighter.prototype.makeEverythingInvisible = function (scene) { || currentObject instanceof THREE.Sprite ) { currentObject.previousVisibility = currentObject.visible; currentObject.visible = false; + currentObject.layers.disable(0); // Invisible } }); }; @@ -113,6 +114,7 @@ ROS3D.Highlighter.prototype.makeHighlightedVisible = function (scene) { if ( currentObject instanceof THREE.Mesh || currentObject instanceof THREE.Line || currentObject instanceof THREE.Sprite ) { currentObject.visible = true; + currentObject.layers.enable(0); // Visible } }; @@ -120,6 +122,7 @@ ROS3D.Highlighter.prototype.makeHighlightedVisible = function (scene) { var selectedObject = this.hoverObjs[uuid]; // Make each selected object and all of its children visible selectedObject.visible = true; + selectedObject.layers.enable(0); // Visible selectedObject.traverse(makeVisible); } }; @@ -134,6 +137,11 @@ ROS3D.Highlighter.prototype.restoreVisibility = function (scene) { scene.traverse(function(currentObject) { if (currentObject.hasOwnProperty('previousVisibility')) { currentObject.visible = currentObject.previousVisibility; + if (currentObject.visible) { + currentObject.layers.enable(0); // Visible + } else { + currentObject.layers.disable(0); // Invisible + } } }.bind(this)); }; diff --git a/src/visualization/interaction/OrbitControls.js b/src/visualization/interaction/OrbitControls.js index 1c8e0720..d1b11300 100644 --- a/src/visualization/interaction/OrbitControls.js +++ b/src/visualization/interaction/OrbitControls.js @@ -81,6 +81,7 @@ ROS3D.OrbitControls = function(options) { scene.add(this.axes); this.axes.traverse(function(obj) { obj.visible = false; + obj.layers.disable(0); // Invisible }); } @@ -376,6 +377,7 @@ ROS3D.OrbitControls.prototype.showAxes = function() { this.axes.traverse(function(obj) { obj.visible = true; + obj.layers.enable(0); // Visible }); if (this.hideTimeout) { clearTimeout(this.hideTimeout); @@ -383,6 +385,7 @@ ROS3D.OrbitControls.prototype.showAxes = function() { this.hideTimeout = setTimeout(function() { that.axes.traverse(function(obj) { obj.visible = false; + obj.layers.disable(0); // Invisible }); that.hideTimeout = false; }, 1000); From 841229cd43e98f5ffe0a6ffd8e8fb1a68f23d552 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sun, 15 Jan 2023 12:09:41 +0100 Subject: [PATCH 6/9] Bump Three to r120 --- examples/continuousmap.html | 4 ++-- examples/depthcloud.html | 4 ++-- examples/interactivemarkers.html | 4 ++-- examples/kitti.html | 4 ++-- examples/map.html | 2 +- examples/markers.html | 2 +- examples/navsatfix.html | 2 +- examples/octree.html | 2 +- examples/pointcloud2.html | 2 +- examples/urdf.html | 2 +- package-lock.json | 14 +++++++------- package.json | 2 +- 12 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/continuousmap.html b/examples/continuousmap.html index df58ac27..afaa14ac 100644 --- a/examples/continuousmap.html +++ b/examples/continuousmap.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/depthcloud.html b/examples/depthcloud.html index 8e537b07..7e8f0f65 100644 --- a/examples/depthcloud.html +++ b/examples/depthcloud.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/interactivemarkers.html b/examples/interactivemarkers.html index 6661efc4..0d12009d 100644 --- a/examples/interactivemarkers.html +++ b/examples/interactivemarkers.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/kitti.html b/examples/kitti.html index 939cbedf..5a819f72 100644 --- a/examples/kitti.html +++ b/examples/kitti.html @@ -3,8 +3,8 @@ - - + + diff --git a/examples/map.html b/examples/map.html index ea763b65..2dfda650 100644 --- a/examples/map.html +++ b/examples/map.html @@ -3,7 +3,7 @@ - + diff --git a/examples/markers.html b/examples/markers.html index 347cfbb5..51377fca 100644 --- a/examples/markers.html +++ b/examples/markers.html @@ -3,7 +3,7 @@ - + diff --git a/examples/navsatfix.html b/examples/navsatfix.html index 2ae578b8..e9a53ffe 100644 --- a/examples/navsatfix.html +++ b/examples/navsatfix.html @@ -3,7 +3,7 @@ - + diff --git a/examples/octree.html b/examples/octree.html index 4fa7daa0..ac42b0aa 100644 --- a/examples/octree.html +++ b/examples/octree.html @@ -3,7 +3,7 @@ - + diff --git a/examples/pointcloud2.html b/examples/pointcloud2.html index 7426db65..09d32b5b 100644 --- a/examples/pointcloud2.html +++ b/examples/pointcloud2.html @@ -3,7 +3,7 @@ - + diff --git a/examples/urdf.html b/examples/urdf.html index 5d8c5c0e..ae50dd4b 100644 --- a/examples/urdf.html +++ b/examples/urdf.html @@ -3,7 +3,7 @@ - + diff --git a/package-lock.json b/package-lock.json index 2d5e6d74..74c799ed 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "~0.113.0" + "three": "~0.120.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", @@ -7628,9 +7628,9 @@ "dev": true }, "node_modules/three": { - "version": "0.113.2", - "resolved": "https://registry.npmjs.org/three/-/three-0.113.2.tgz", - "integrity": "sha512-x3vrKW41/UtbWbWduWKGlfIc043SvHWr3YltehYq+UGb9YglQ2oztNGvl2eut05JtNSmP11Mh3t6Xak5/0e+Fg==", + "version": "0.120.1", + "resolved": "https://registry.npmjs.org/three/-/three-0.120.1.tgz", + "integrity": "sha512-ktaCRFUR7JUZcKec+cBRz+oBex5pOVaJhrtxvFF2T7on53o9UkEux+/Nh1g/4zeb4t/pbxIFcADbn/ACu3LC1g==", "license": "MIT" }, "node_modules/through": { @@ -14361,9 +14361,9 @@ "dev": true }, "three": { - "version": "0.113.2", - "resolved": "https://registry.npmjs.org/three/-/three-0.113.2.tgz", - "integrity": "sha512-x3vrKW41/UtbWbWduWKGlfIc043SvHWr3YltehYq+UGb9YglQ2oztNGvl2eut05JtNSmP11Mh3t6Xak5/0e+Fg==" + "version": "0.120.1", + "resolved": "https://registry.npmjs.org/three/-/three-0.120.1.tgz", + "integrity": "sha512-ktaCRFUR7JUZcKec+cBRz+oBex5pOVaJhrtxvFF2T7on53o9UkEux+/Nh1g/4zeb4t/pbxIFcADbn/ACu3LC1g==" }, "through": { "version": "2.3.8", diff --git a/package.json b/package.json index 8e0f5458..da7fdb20 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "dependencies": { "eventemitter3": "^5.0.1", "roslib": "^1.0.0", - "three": "~0.113.0" + "three": "~0.120.0" }, "devDependencies": { "@rollup/plugin-buble": "^1.0.0", From 5c987007f9ea18910439dc567509c431c35bd620 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Sun, 22 Jan 2023 16:23:18 +0100 Subject: [PATCH 7/9] Compatible with Three R123 --- src/interactivemarkers/InteractiveMarker.js | 2 +- src/interactivemarkers/InteractiveMarkerControl.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/interactivemarkers/InteractiveMarker.js b/src/interactivemarkers/InteractiveMarker.js index f4e4f821..d4f3ba95 100644 --- a/src/interactivemarkers/InteractiveMarker.js +++ b/src/interactivemarkers/InteractiveMarker.js @@ -212,7 +212,7 @@ ROS3D.InteractiveMarker.prototype.rotateAxis = function(control, origOrientation // rotates from world to plane coords var orientationWorld = this.dragStart.orientationWorld.clone().multiply(orientation); - var orientationWorldInv = orientationWorld.clone().inverse(); + var orientationWorldInv = orientationWorld.clone().invert(); // rotate original and current intersection into local coords intersection.sub(rotOrigin); diff --git a/src/interactivemarkers/InteractiveMarkerControl.js b/src/interactivemarkers/InteractiveMarkerControl.js index 2af0daea..7f467694 100644 --- a/src/interactivemarkers/InteractiveMarkerControl.js +++ b/src/interactivemarkers/InteractiveMarkerControl.js @@ -138,7 +138,7 @@ ROS3D.InteractiveMarkerControl = function(options) { var posInv = this.parent.position.clone().multiplyScalar(-1); switch (message.orientation_mode) { case ROS3D.INTERACTIVE_MARKER_INHERIT: - rotInv = this.parent.quaternion.clone().inverse(); + rotInv = this.parent.quaternion.clone().invert(); break; case ROS3D.INTERACTIVE_MARKER_FIXED: break; @@ -231,7 +231,7 @@ ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld = function (force) { that.currentControlOri.normalize(); break; case ROS3D.INTERACTIVE_MARKER_FIXED: - that.quaternion.copy(that.parent.quaternion.clone().inverse()); + that.quaternion.copy(that.parent.quaternion.clone().invert()); that.updateMatrix(); that.matrixWorldNeedsUpdate = true; ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld.call(that, force); @@ -247,7 +247,7 @@ ROS3D.InteractiveMarkerControl.prototype.updateMatrixWorld = function (force) { ros2Gl.makeRotationFromEuler(rv); var worldToLocal = new THREE.Matrix4(); - worldToLocal.getInverse(that.parent.matrixWorld); + worldToLocal.copy(that.parent.matrixWorld).invert(); cameraRot.multiplyMatrices(cameraRot, ros2Gl); cameraRot.multiplyMatrices(worldToLocal, cameraRot); From 9d4e945651babde4906f24f9e27e49ee4356f882 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Tue, 11 Jun 2024 10:56:29 +0200 Subject: [PATCH 8/9] Migrate from deprecated LinePrecision --- src/visualization/interaction/MouseHandler.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/visualization/interaction/MouseHandler.js b/src/visualization/interaction/MouseHandler.js index 94a85e81..e5f3c729 100644 --- a/src/visualization/interaction/MouseHandler.js +++ b/src/visualization/interaction/MouseHandler.js @@ -71,7 +71,7 @@ ROS3D.MouseHandler.prototype.processDomEvent = function(domEvent) { var mousePos = new THREE.Vector2(deviceX, deviceY); var mouseRaycaster = new THREE.Raycaster(); - mouseRaycaster.linePrecision = 0.001; + mouseRaycaster.params.Line.threshold = 0.001; mouseRaycaster.setFromCamera(mousePos, this.camera); var mouseRay = mouseRaycaster.ray; From 823814705e665d4265c466013f63d0b35e56fd29 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Tue, 11 Jun 2024 11:01:51 +0200 Subject: [PATCH 9/9] Bump Three to r123 --- examples/continuousmap.html | 2 +- examples/depthcloud.html | 2 +- examples/interactivemarkers.html | 2 +- examples/kitti.html | 2 +- examples/map.html | 2 +- examples/markers.html | 2 +- examples/navsatfix.html | 2 +- examples/octree.html | 2 +- examples/pointcloud2.html | 2 +- examples/urdf.html | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/continuousmap.html b/examples/continuousmap.html index afaa14ac..236c5eb6 100644 --- a/examples/continuousmap.html +++ b/examples/continuousmap.html @@ -3,7 +3,7 @@ - + diff --git a/examples/depthcloud.html b/examples/depthcloud.html index 7e8f0f65..b6e0ac39 100644 --- a/examples/depthcloud.html +++ b/examples/depthcloud.html @@ -3,7 +3,7 @@ - + diff --git a/examples/interactivemarkers.html b/examples/interactivemarkers.html index 0d12009d..68be1ab7 100644 --- a/examples/interactivemarkers.html +++ b/examples/interactivemarkers.html @@ -3,7 +3,7 @@ - + diff --git a/examples/kitti.html b/examples/kitti.html index 5a819f72..f5ec1396 100644 --- a/examples/kitti.html +++ b/examples/kitti.html @@ -3,7 +3,7 @@ - + diff --git a/examples/map.html b/examples/map.html index 2dfda650..77f1a6c6 100644 --- a/examples/map.html +++ b/examples/map.html @@ -3,7 +3,7 @@ - + diff --git a/examples/markers.html b/examples/markers.html index 51377fca..296bd6a0 100644 --- a/examples/markers.html +++ b/examples/markers.html @@ -3,7 +3,7 @@ - + diff --git a/examples/navsatfix.html b/examples/navsatfix.html index e9a53ffe..61fc50b0 100644 --- a/examples/navsatfix.html +++ b/examples/navsatfix.html @@ -3,7 +3,7 @@ - + diff --git a/examples/octree.html b/examples/octree.html index ac42b0aa..c9d54a9b 100644 --- a/examples/octree.html +++ b/examples/octree.html @@ -3,7 +3,7 @@ - + diff --git a/examples/pointcloud2.html b/examples/pointcloud2.html index 09d32b5b..76426090 100644 --- a/examples/pointcloud2.html +++ b/examples/pointcloud2.html @@ -3,7 +3,7 @@ - + diff --git a/examples/urdf.html b/examples/urdf.html index ae50dd4b..c5ca7904 100644 --- a/examples/urdf.html +++ b/examples/urdf.html @@ -3,7 +3,7 @@ - +