Browse Source

Override toJSON in TubeGeometry

Temdog007 6 years ago
parent
commit
b966dc7d8b
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/geometries/TubeGeometry.js

+ 8 - 0
src/geometries/TubeGeometry.js

@@ -219,5 +219,13 @@ function TubeBufferGeometry( path, tubularSegments, radius, radialSegments, clos
 TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
 TubeBufferGeometry.prototype.constructor = TubeBufferGeometry;
 
+TubeBufferGeometry.prototype.toJSON = function () {
+
+	var data = BufferGeometry.prototype.toJSON.call( this );
+
+	data.path = this.parameters.path.toJSON();
+
+	return data;
+};
 
 export { TubeGeometry, TubeBufferGeometry };