Ver Fonte

Override toJSON for TubeGeometry

Temdog007 há 6 anos atrás
pai
commit
8d5a623a3d
1 ficheiros alterados com 8 adições e 0 exclusões
  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 };