Browse Source

Override toJSON in TubeGeometry

Temdog007 6 năm trước cách đây
mục cha
commit
b966dc7d8b
1 tập tin đã thay đổi với 8 bổ sung0 xóa
  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 };