Skip to content

Commit b091cf6

Browse files
committed
Compatible with Three R110
1 parent ef855e0 commit b091cf6

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"dependencies": {
1010
"eventemitter2": "^6.4.0",
1111
"roslib": "^1.0.0",
12-
"three": "^0.89.0"
12+
"three": "~0.100.0"
1313
},
1414
"devDependencies": {
1515
"@rollup/plugin-buble": "^1.0.0",

src/navigation/OcTreeBase.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ ROS3D.OcTreeBase.prototype.buildGeometry = function () {
408408
opacity: this.opacity
409409
});
410410

411-
geometry.addAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3));
412-
geometry.addAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3));
413-
geometry.addAttribute('color', new THREE.BufferAttribute(new Float32Array(colors), 3));
411+
geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array(vertices), 3));
412+
geometry.setAttribute('normal', new THREE.BufferAttribute(new Float32Array(normals), 3));
413+
geometry.setAttribute('color', new THREE.BufferAttribute(new Float32Array(colors), 3));
414414

415415
geometry.setIndex(indices);
416416

src/sensors/NavSatFix.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ROS3D.NavSatFix = function(options) {
3737

3838
this.geom = new THREE.BufferGeometry();
3939
this.vertices = new THREE.BufferAttribute(new Float32Array( 6 * this.keep ), 3 );
40-
this.geom.addAttribute( 'position', this.vertices);
40+
this.geom.setAttribute('position', this.vertices);
4141
this.material = material.isMaterial ? material : new THREE.LineBasicMaterial( material );
4242
this.line = new THREE.Line( this.geom, this.material );
4343
this.rootObject.add(this.object3d);

src/sensors/Points.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ ROS3D.Points.prototype.setup = function(frame, point_step, fields)
5757
this.geom = new THREE.BufferGeometry();
5858

5959
this.positions = new THREE.BufferAttribute( new Float32Array( this.max_pts * 3), 3, false );
60-
this.geom.addAttribute( 'position', this.positions.setDynamic(true) );
60+
this.geom.setAttribute('position', this.positions.setDynamic(true) );
6161

6262
if(!this.colorsrc && this.fields.rgb) {
6363
this.colorsrc = 'rgb';
@@ -66,7 +66,7 @@ ROS3D.Points.prototype.setup = function(frame, point_step, fields)
6666
var field = this.fields[this.colorsrc];
6767
if (field) {
6868
this.colors = new THREE.BufferAttribute( new Float32Array( this.max_pts * 3), 3, false );
69-
this.geom.addAttribute( 'color', this.colors.setDynamic(true) );
69+
this.geom.setAttribute('color', this.colors.setDynamic(true) );
7070
var offset = field.offset;
7171
this.getColor = [
7272
function(dv,base,le){return dv.getInt8(base+offset,le);},

0 commit comments

Comments
 (0)