瀏覽代碼

Override toJSON in TubeGeometry

Temdog007 6 年之前
父節點
當前提交
b966dc7d8b
共有 1 個文件被更改,包括 8 次插入0 次删除
  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 = Object.create( BufferGeometry.prototype );
 TubeBufferGeometry.prototype.constructor = TubeBufferGeometry;
 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 };
 export { TubeGeometry, TubeBufferGeometry };